Solved

Show WP thumbnails differently depending on category

Posted on 2014-01-24
1
160 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress - Change Request System 3 31
Gradient CSS 4 36
Securing Wordpress 3 91
Wordpress Pagination 1 29
Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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…

860 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