Forums

PHP, Pagination and query post issues with video and text posts (1 post)

  1. smoynihan
    Member
    Posted 3 months ago #

    I need to display the first post of a specific post type in a "featured video" sidebar that includes the video and a description of the video. Right now, all of our posts are paginated, but I can't figure out how to feature the first video/post in a seperate side bar while keeping the rest of the posts paginated and not included the featured post.

    Here's my code as is and here's the link to the page im working on: dev.planetforward.org/sandi

    <?php get_header(); ?>
    <div id="container" class="span-24">
    <div id="one" class="span-24 last">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php $parent = $post->ID; ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>
    </div>

    <div id="two" class="span-24 last"><h3>Previous shows:</h3>
    <?php
    wp_reset_query();
    $limit = get_option('posts_per_page=');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $more = 0;
    query_posts('post_type=nbr&paged=' . $paged);
    $wp_query->is_archive = true; $wp_query->is_home = false;
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php $embed = get_post_meta($post->ID, 'meta_video_value_1', true); ?>
    <?php $idea = get_post_meta($post->ID, 'meta_relationship', true); ?>
    <div class="span-24 contained" style="margin-top: 20px;">
    <div class="span-18"><div class="inside">
    <h2 class="archive">"><?php the_title(); ?></h2>
    <?php the_excerpt(); ?>
    </div></div>
    <div class="span-6 last"><div class="inside">
    <?php get_pfv2_thumbnail($embed); ?>
    </div></div>
    </div>
    <?php endwhile; endif; ?>
    <?php next_posts_link(); ?>
    <?php previous_posts_link(); ?>

    </div>

    </div>
    <?php get_footer(); ?>

Reply

You must log in to post.

About this Topic