Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

They all uses a single archive.php, and it works wonderfully to display category-specific images. See the current code here

What I'd like to achieve is to

query for the latest post only for the selected category, and feature it on top of the thumbnails as a slideshow like the one from the homepage. *)

*) latest post in automotive for automotive category archive, latest post in architecture for architecture category, so on…

My beginner's hack from a few goolge search can be seen here.

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

Any help would be much appreciated.

share|improve this question

1 Answer 1

The easiest way to do this is to simply make a category.php template file, that way you're not jamming everything into one template with multiple query's and conditionals.

http://codex.wordpress.org/Template_Hierarchy#Category_display

It is unclear what you mean by "featured", do you want an url like http://example.com/portfoliography/architecture to have a select posts at the top? Or do you want the category page to feature certain categories above others?

share|improve this answer
    
That's right, I want a category archive to feature one (latest) post for each respective category. –  willio Mar 7 '12 at 8:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.