By Rick Palo on Friday, 21 October 2022
Posted in Technical Issues
Replies 3
Likes 0
Views 414
Votes 0
In a previous version of EasyBlog, I modified the Elegant template to add date information after the author avatar. After the div with class eb-post-author-avatar, I would like to insert the following html:
<div>
<div class="eb-post-calendar" content="2021-12-28">
<div class="eb-post-calendar-m">Dec</div>
<div class="eb-post-calendar-d"> 28</div>
<div class="eb-post-calendar-y"> 2021</div>
</div>
</div>
I found the 'list/default.php' file to override, but I can't figure out the specific $post variables/functions to use in order to insert correctly. Is there a simple method to do this?
Hey there,

You can try the following PHP code and see how it goes:


<?php $created = $post->getDisplayDate(); ?>
<div>
<div class="eb-post-calendar" content="<?php echo $created->format('Y-m-d'); ?>">
<div class="eb-post-calendar-m"><?php echo $created->format('M'); ?></div>
<div class="eb-post-calendar-d"><?php echo $created->format('d'); ?></div>
<div class="eb-post-calendar-y"><?php echo $created->format('Y'); ?></div>
</div>
</div>


Since you mentioned "After the div with class eb-post-author-avatar, I would like to insert the following html", you can do the template override at Backend > EasyBlog > Themes > Vintage > select Edit Files > choose "\entry/default/default.php" > you can start to edit it.

Because only entry/default/default.php and entry/default/default.protected.php in Vintage theme have this eb-post-author-avatar class.
·
Friday, 21 October 2022 11:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect! Thank you! Is that API publicly available?
·
Friday, 21 October 2022 22:31
·
0 Likes
·
0 Votes
·
0 Comments
·
I am really sorry for the delay in this reply as it was a weekend and a public holiday for us here.

You're most welcome.

If the method of $post which is coming from JoomlaFolder/administrator/components/com_easyblog/includes/post/post.php is public then you can use it anywhere.

EDITED
·
Tuesday, 25 October 2022 10:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post