-
AuthorPosts
-
October 24, 2019 at 3:18 pm #1150913
Hello,
On single posts, the date is located at the end of the article. How can I move it to the top of the article (below the category, for example)? And is it possible to add “Published on” before the date?
In the magazine presentation, I would also like to add “Published on” before the date because when the post is about an event, I’ve had people think the post date is the event date. Is it possible and where could I do that? I Iooked into magazine.php but can’t seem to make it work.
Thanks!
October 25, 2019 at 3:13 pm #1151222Hi,
I solved one of my two questions. For the magazine presentation, to add “Published on” before the date, I went into /enfold/config-templatebuilder/avia-shortcodes/magazine/magazine.php and replaced the following line:
$output .= "<time class='av-magazine-time updated' {$markupTime}>".$time."</time>";
with
$output .= "<time class='av-magazine-time updated' {$markupTime}>".__('Posted on ','avia_framework')."".$time."</time>";
And to do it in the child’s theme instead, I followed theses instructions:
I’m still searching for how to do this on single posts, in addition to moving the date at the top of the content on posts.
Thanks!
- This reply was modified 5 years, 1 month ago by darryllevine.
October 25, 2019 at 3:57 pm #1151237I finally found how to move the date to the top of the posts. See: https://kriesi.at/support/topic/move-date-in-post-to-top/
But I’m still not sure how to add “Posted on” before the date in the post.
Any ideas? Thanks!October 28, 2019 at 4:47 am #1151663Hi,
We’re glad to hear that.
Go to wp-content > themes > enfold > includes > loop-index.php (line 305):echo "<time class='date-container minor-meta updated' >".get_the_time(get_option('date_format'))."</time>";
Insert it text there.
Best regards,
NikkoOctober 28, 2019 at 5:14 pm #1151833Hello,
Thank you! Can you tell me exactly where I need to put it (and in a way for the text to be translatable)? Because I tried to add it in that line of code, but it breaks the site, so there’s something I’m not doing right.
Is it also possible to put it in the child’s theme? Or must I change that file after each update?
Also, regarding moving the date to the top of the post, is there any other way than the one explained here (https://kriesi.at/support/topic/move-date-in-post-to-top/)? I’m asking because on most posts we do not use the builder and when that is the case, the date is not positioned correctly, if overlaps other content.
Thank you.
October 29, 2019 at 1:35 pm #1152052Hi darryllevine,
In your child theme, create a folder and name it includes then inside it create a file called loop-index.php (this will override loop-index.php in the enfold theme).
Then paste this code: https://pastebin.com/HFcbR3um
It’s basically derived from loop-index.php then replaced line 305 I mentioned in the previous post then move it to the top.
Hope this helps.Best regards,
NikkoOctober 29, 2019 at 4:17 pm #1152094Perfect, thank you very much Nikko. I still sometimes have a problem when not using the builder, but I add a spacer and it corrects the problem.
Thanks!October 29, 2019 at 8:43 pm #1152135I just noticed that this code seems to be preventing the featured image from appearing at the top of the article.
October 30, 2019 at 7:46 am #1152224Hi darryllevine,
Thanks for pointing it out, it can be fixed by adding this css code in Quick CSS:
#top #main .post-entry .post-meta-infos { float: none; }
Best regards,
NikkoOctober 30, 2019 at 3:23 pm #1152385Thank you! It also corrected the overlapping/spacer problem.
October 30, 2019 at 3:50 pm #1152390Hi darryllevine,
We’re glad to hear that :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Moving post date and adding text in front ("Published on")’ is closed to new replies.