Query post for 'selected category' in archive.php (1 post)

  1. willio
    Posted 3 years ago #

    I'm trying to figure out how to display a 'featured post' on a selected category archive.

    My website uses the category-based navigation for different types of posts (text only post--blog, and image only gallery post), and is driven by a single custom archive.php.

    Homepage: http://portfoliography
    Auto gallery: http://portfoliography.com/automotive
    Architecture gallery: http://portfoliography/architecture
    (... and so on)

    They all uses a single archive.php, and it works wonderfully to display category-specific images. See the current code here: http://pastebin.com/1vVrMF28

    What I'd like to achieve is to query for the latest post only for the selected category (latest post in automotive for automotive category archive, latest post in architecture for architecture category, so on...) , and feature it on top of the thumbnails as a slideshow like the one from the homepage.

    My beginner's hack from a few goole search produces the following: http://pastebin.com/p4qXnDtN

    But the said code generates a slideshow using images from posts in every category.

    Any help would be much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic