• I’m using the Nimble theme from Elegant Themes: https://www.elegantthemes.com/gallery/nimble/

    I want certain categories on my site to display the date in the category listing, but not others.

    I can think of two ways to do this. One, for those categories I don’t want to have the meta info, I don’t need to grab the meta info at all. So, I can put a conditional around this line based on whether or not the post is in the right category:

    et_postinfo_meta( $index_postinfo, et_get_option('nimble_date_format'), esc_html__('0 comments','Nimble'), esc_html__('1 comment','Nimble'), '% ' . esc_html__('comments','Nimble') );

    Let’s say that line shouldn’t trigger if the post is in Category1, but it should trigger if the post is in any other category. How do I do that?

    I’ve tried…

    in_array('Category1', get_the_category())

    get_the_category()=='Category1'

    And more stuff I can’t even remember anymore.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Changing post meta info based on category?’ is closed to new replies.