Solved

Show WP thumbnails differently depending on category

Posted on 2014-01-24
1
157 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
Comment Utility
Ended up fixing it by adding a second loop with

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

where the negative number is the category ID.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

WordPress has made it easy to create scalable sites based on their powerful CMS, but as great as WordPress is, there are some SEO issues that haven’t been addressed out of the box.  Fortunately these problems can be solved with a few plugins.  The f…
How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now