While dealing with the support queries we have received one of the common question getting asked by our Directory theme users is “How do I show the author of the listing on the listing detail page“. So we thought why not create a public tutorial for this as it would be helpful for others too.

In this tutorial we are showing how to Show author info along with date, time on listing detail page, you can do it for any other post type(s) also.

Author info is actually showing for WP posts by default, but its not included for listings on its details page by default with this theme.

To show author info at listing detail page, you just need to edit a file as explained in below steps:

  • Open the single-listing.php template from your wp-content/ plugins/ Tevolution-Directory/ templates/ folder. Here is the code that you will need to add in that file:
<p class="tmpl-sing-listing tmpl-author"><label><?php _e('Posted by: ',T_DOMAIN);?></label><span class="listing_author"><?php the_author_posts_link(); ?></span></p>
  • Add it to the template wherever you want it to appear. I put it at top above this line :
<!-- start content part-->
  • This is a screenshot for your reference to know how it can be done in that file as explained in above steps:

authorcode

  • Save this file again with above changes.
  • After following above steps the changes will be appearing at detail page of listings as shown into this image:

detailpage

  • It will be appearing like this on front end listing detail page and by this way it can be done on your site too.

Tip: You can follow the same process for any other post type(s) also like, events, properties, jobs, classifieds, deals OR any other created by you using Tevolution plugin. Just a file will different according to the post type as we have used “single-listing.php” here for listing post type. So you will need to deal with its associated file for which post type you want to show author info on detail page.