How to add featured post in category only

Community Forums Forums Design Tips and Tricks How to add featured post in category only

This topic is: not resolved

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #106945

    barnabasnagy
    Member
    Post count: 1

    I want to set up a featured post for a specific category only. Eg If I have a blog with 2 categories (“Lifestyle” and “Farming”). Then I would want to be able to set up a featured post for Lifestyle and a another different post for Farming. This featured post would be always on top of the category page.

    Any ideas how could I do this?

    #106959

    braddalton
    Participant
    Post count: 10575

    Hook in a new widget before the loop on your category archive conditionally from your functions file and populate it with the Genesis featured posts widget.

    Or you could use WP_Query and hook it in using a variety of methods like a template tag or get_template_part.

    Another option is to hard code it into a category template file.

    Here’ an example you can use and change the conditional tag in the code http://wpsites.net/web-design/add-content-before-posts-blog-page-only/

    If you want to hard code this into a template, this is the way to name your file . Template Hierarchy http://codex.wordpress.org/Template_Hierarchy


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.