Post_Class Category…imputing complete different styles in index
-
I am developing a personal theme that has a different post style for 3 different categories. Inspired by Tumblrs different images per category.
I understand that post_class can help you achieve this but I am asking for a completely different style post (including alignment within the image box).. versus just a header color change.
Here is a mark-up through html of what I want to achieve…(The post at the bottom if category specific) Mark-Up
As noted: (for the rest of my content post is have this)
<div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div id="post" <?php the_ID(); ?>> <div class="posttop"></div> <div id="postmiddle"> <div class="posttitle"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></div> <div id="info"><small>Born On:</small> <?php the_date('F jS, Y'); ?></div> <div id="info2"><small>Subject:</small> <?php the_category(', '); ?></div> <?php the_content('Read More???'); ?> </div> <div class="postbottom"> Comments (<?php comments_popup_link('0', '1', '%', '', __('Off')); ?>) * Like (48)</div> </div>
But I want this code to be added for if(category-sounds):
<div id="musicsheet"> <div class="posttitle"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></div> <div id="infocenter"> <div id="info3">Born On: <?php the_date('F jS, Y'); ?></div> </div> <?php the_content(); ?> <div class="like">Like (27)</div> </div>
Now in post_class: it states in css style for “.category_sounds” to implement the image and size and such…. but what about the positioning inside? How would it be able to call those even if I did have “.category_sounds .info3”, how can it pick it up without html?
And how would that convert to functions.php?
I dont see anybody doing this in WordPress..
I really would like to know how this would be executed? Thank You
- The topic ‘Post_Class Category…imputing complete different styles in index’ is closed to new replies.