Solved

Show WP thumbnails differently depending on category

Posted on 2014-01-24
1
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
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 update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

734 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