Baskerville 2 comments, dates, categories on post details for front page

  • Unknown's avatar

    On the demo for baskerville 2 it shows the date on the bottom of each post in the front page gallery without the comment count. I have the date, but can’t seem to remove the comment count. I’d like to replace the comment count with the category if possible. Is there a way to change that up? I have looked in the customizer under post detail and have tried checking and unchecking the boxes.

    The blog I need help with is: (visible only to logged in users)

  • Hi @lhawkinsjackson!

    There isn’t currently an option to hide the comment link, but you can use your Custom CSS to do it :)

    .blog a.post-comments {
    	display: none;
    }

    Baskerville 2 wasn’t built to display categories on the home page, and I’m afraid CSS can’t pull in that data for us – but the comments can be hidden! :)

    UPDATE: read further for an improved answer :)

  • Unknown's avatar

    Hi staff-loquaciousloon,

    I hope it’s OK I ask here without starting a new thread (?). I tried solving this by targeting just the a.post-comments, and couldn’t get it to work. Why does it work by adding the .blog class? I can’t seem to find any HTML elements with this class assigned to it.

  • Hi @jjberg83!

    Perfect place to ask :)

    The .blog class gets added to the page’s body element on the Posts Page.

    The reason that a.post-comments alone doesn’t work is that the comment link’s display value is original set like this:

    .posts a.post-comments {
    	display: block;
    }

    .posts a.post-comments is more specific than a.post-comments – so when those two styles clash, the original one wins. Adding the .blog makes it specific enough to take over.

    Having said all of that though, I’m thinking this might be a better approach than my initial suggestion:

    .posts a.post-comments {
    	display: none;
    }

    .blog will only impact the main Posts Page. .posts will hit all of the pages that show more than one page (like category pages, for example) so it’s a more complete solution :)

  • Unknown's avatar

    Thanks for the clarification staff-loquaciousloon =)

  • My pleasure! Thanks for asking a question that led to improved CSS :)

  • The topic ‘Baskerville 2 comments, dates, categories on post details for front page’ is closed to new replies.