This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Theme_Blvd Mini Post List

  • Creator
    Topic
  • #26154
    kennethfeldman
    Participant

    Hi Jason,

    I have a Theme_Blvd Mini Post List in a sidebar which appears on all posts of a certain (custom) post type. This acts as a sidebar menu navigation to each of the sibling posts (we have about 7 or 8 posts in each of these groups).

    In a regular sidebar pages nav menu (like in the main menu bar up top), there is a class added of “current-page-item” or similar, which helps us present an “on-page” style for the nav link of the current page.

    Below is the output of the Theme_Blvd Mini Post List — each post in the list is an ARTICLE, with lots of classes, but no “current page” class.

    <article class="has-thumbnail post-1427 video type-video status-publish format-standard has-post-thumbnail hentry category-new-item category-videos style-qqqqq purpose-bbbbb purpose-rrrrrr-hhhhhhh">
    
    -------
    
    </article>

    Is there a way to add current page/post awareness to the items listed in the Theme_Blvd Mini Post List?

    If there is a way, that would be so great because then I could highlight those links to indicate the “on-this-page” status.

    Thanks in advance if you can help here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #26160
    Jason Bobich
    Keymaster

    Hi,

    These classes are generated with the WordPress function post_class().

    https://codex.wordpress.org/Function_Reference/post_class

    If you copy content-mini-list.php, you’ll see there’s a $class variable at the top you can add to.

    Or, you can target it by filtering from your child theme’s functions.php.

    https://codex.wordpress.org/Function_Reference/post_class#Add_Classes_By_Filters

    #26170
    kennethfeldman
    Participant

    Thanks Jason,

    I see how that all works in general.

    But it seems to be putting a new class (category nice name) into the body, and all article divs on the entire page.

    However what I’m looking for is to only add a class of current_page_item to only the mini-post-list item (or article in the list) of the current page that is being displayed.

    This way, the mini post list in the sidebar can be styled to indicate which is the currently viewed post.

    Any way to do that?

    #26171
    Jason Bobich
    Keymaster

    So then you want to use the first method I described of working with content-mini-list.php.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.