Grow your CSS skills. Land your dream job.

Wordpess Loop Help

  • # October 13, 2012 at 1:41 am

    I’ve been working on a wordpress post loop. I have it set to show 12 items and then show the Next/Previous buttons. Can anyone help?

    I also wanted to try to figure out how to add a banner that spans 100% after 6 items have been show.

    < ?php query_posts('category_name=Portfolio'); ?>
    < ?php if ( have_posts() ) : ?>
    < ?php $i = 1; while (have_posts() && $i < 12) : the_post(); ?>
    < ?php if($i == 1) {?>

    < ?php } ?>

    < ?php the_post_thumbnail();?>

    < ?php the_title(); ?>

    < ?php if(get_post_meta($post->ID, ‘Website_URL’, true)) { ?>
    ID, ‘Website_URL’, true) ?>” target=”_blank”>Link 1
    < ?php } ?>
    “> Link 2

    < ?php if($i == 3) { ?>

    < ? } ?>
    < ?php $i++; endwhile; ?>

    < ?php next_posts_link(); ?>

    < ?php previous_posts_link(); ?>

    < ?php else : ?>

    Not Found

    Silly monkey.

    < ?php endif; ?>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".