WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need some tools to handle page/post layout in some specific cases -- for example, some post should render post thumbnail on the right side (not left), some "related post" item should not be linked in some posts etc.

Now I guess that I could create 'layout_tax' taxonomy with values 'right_thumb', 'hide_pieces_link' etc-etc. And then I would use it to "trigger" needed behavior.

Please, what are drawbacks of this approach? For example, each of these taxonomies do not need to have archive page, appear as keyword in <head> or like that.

What would be better way instead?


share|improve this question
up vote 1 down vote accepted

Taxonomies are sort of overkill in this case. Taxonomies are not required to have an archive page (they can be used for internal things only). Your nav menus, for example, are terms in a taxonomy -- just a way of grouping content that belongs together. What you're talking about is a bit outside of that scope.

I'd suggest you create a little meta box. Give yourself whatever options you need, and filter post_class to change the styling. You can also, of course, include or not include things based on a postmeta value. Here's an example.

Then you just style with css, using selectors like .post.left_thumb or something similar.

Or you could grab the meta value in your single.php and change the layout based on that.

$layout = get_post_meta( $post->ID, '_wpse32973_layout', true );

if( 'left_thumb' == $layout )
    // do stuff
    // do other stuff

You could also use template parts and avoid some if statements in your templates.

$layout = get_post_meta( $post->ID, '_wpse32973_layout', true );

// make sure layout always has a value.
$layout = $layout ? $layout : 'some_default_thing';

get_template_part( 'content', $layout );

Anyway, lots of options to avoid a taxonomy, which I think is not a great choice for this situation.

share|improve this answer
thank you a lot, i'll dig.. – brownian Nov 5 '11 at 14:57
Thank you for rich examples. – brownian Nov 6 '11 at 18:21

Your Answer


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.