[Resolved] I have the code I need – but problems inserting it
I have two columns – one for latest posts, and the other for posts in a ‘featured’ category.
When I publish a new featured post, I want it to appear as a latest post, but not also appear on the featured posts column at the same time. To do this, I believe I need to use/adapt code from one of the following links:
The only problem is, I don’t understand the code enough in order to make in work on my template/website. I’m sure it’s simple to install and that makes it very frustrating. Can someone please point me in the right direction?
Here are the relevant loops on my index.php page:
Latest posts loop:
<div class="latestpost"> <?php if (have_posts()) : ?> <?php query_posts("showposts=1"); // show one latest post only ?> <?php while (have_posts()) : the_post(); ?> <?php do_atomic( 'before_entry' ); // origin_before_entry ?> <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>"> <?php do_atomic( 'open_entry' ); // origin_open_entry ?> -----content goes here----- <?php do_atomic( 'close_entry' ); // origin_close_entry ?> </div><!-- .hentry --> <?php do_atomic( 'after_entry' ); // origin_after_entry ?> <?php endwhile; ?> <?php query_posts("showposts=5&offset=1"); // show 4 latests posts excluding the latest ?> <?php else : ?> <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?> <?php endif; ?> </div><!-- .latestpost -->
Featured posts loop:
<div class="ifeed"; /*third column*/ > <?php $topbox = get_posts('numberposts=3&category=8'); foreach($topbox as $post) : setup_postdata($post); ?> -----content goes here------ <?php endforeach; ?> </div><!-- .ifeed -->
- The topic ‘[Resolved] I have the code I need – but problems inserting it’ is closed to new replies.