• Resolved ourintentionalfarm

    (@ourintentionalfarm)


    HI! I am trying to add the number of comments after the date of the post. I’ve found some threads with codes to add after author but we do not display authors on our site. Is there a way to do this using only the custom CSS option? I just don’t want to mess my site up messing with PHP. But if I MUST use PHP, instructions on where to add it would be helpful, I haven’t seen that specific instruction on any of the previous threads I’ve seen.

    Simone

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    There is no way to use CSS alone, comment count has to come from PHP. The right file to edit depends on the post format. Additionally, when you edit templates, the altered template should be kept in child theme or else your edits will be lost during the next theme update. It’s a bit of a process to create, but once done, all manner of custom work can be safely kept there.

    Assuming you are only using the standard post format, edit the twentyseventeen theme’s template-parts/post/content.php template file. Find the line for the post date: echo twentyseventeen_time_link();
    For me it was line 28 but I’ve not recently updated this theme, YMMV.

    Enter a new line right below this and add:
    echo ' - ', get_comments_number(), ' comments ';
    Save the altered file to your child theme, using the exact same folder structure as the parent.

    You may do similarly as you wish for other format templates in the same folder.

    Thread Starter ourintentionalfarm

    (@ourintentionalfarm)

    Thanks so much! Will give this a try. Appreciate your detailed instructions.

    Thread Starter ourintentionalfarm

    (@ourintentionalfarm)

    IT WORKED! Finally some clear instructions for a novice like me. Thank you so very much @bcworkz

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding Comment Count After Post Date’ is closed to new replies.