• I am trying to learn how to make a div. What I want is for each div in the body of the blog to be assigned a tag (there are two authors on the blog) so that it sorts the posts into their respective columns (divs). I started with the Kubrick template cause I thought it was real basic. Can anyone point me in the right direction? This is a different request from the “magazine style” templates some people use… Thanks!

    tony

    hippievstony.com

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could try using get_the_author.

    <?php
    if(have_posts()) : while(have_posts()) : the_post(); ?>
    $style='';
    if(get_the_author == 'Bob Smith') $style=bob';
    elseif(get_the_author == 'Fred Jones') $style=fred';
    ?>
    <div <?php post_class(<?php echo $style;?>);?>>
    Thread Starter shatterjack

    (@shatterjack)

    if I am only using the online CSS stylesheet editor on an existing kubrick theme, where do I put the php code? Sorry I can tell this is a stupid question…

    You’d need to edit index.php and, probably, archive.php as well.

    Thread Starter shatterjack

    (@shatterjack)

    thanks esmi,
    I finally got my blog hosted by bluehost and got wordpress setup on there. Could you explain what I should edit in index.php and archive.php?
    Just to sort the posts into two columns for hippie and for tony. If you know a website that is using this function, I could check that out too. thanks!
    tony

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Divide Content Area into Two Divs, Assign Each a Tag’ is closed to new replies.