Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show WP thumbnails differently depending on category

Posted on 2014-01-24
1
Medium Priority
?
166 Views
Last Modified: 2014-01-31
I've created a loop that's getting posts of a certain category and displaying them correctly.  I know have a new sub-category in that loop where the images have a different dimension and don't fit inside the existing CSS layouts.

Is there a way to distinguish and define the layout based on category?

I'm using (in_category('category-name')) currently which is working to define, but it displays twice since I can't remove it from the overall loop.

When I remove the category from the loop using query_posts('cat' => -150) it obviously removes completely.
0
Comment
Question by:axessJosh
1 Comment
 
LVL 2

Accepted Solution

by:
axessJosh earned 0 total points
ID: 39825323
Ended up fixing it by adding a second loop with

array('category' => '- 1');

where the negative number is the category ID.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question