• Resolved goldmember

    (@goldmember)


    on this page (https://www.dianahoppe.com/), i just want to list one post (post #9) below where it says Featured Product. please advise what i would do to just list this one particular post?

    below is all the code in my index.php file below my welcome featured product H2.

    `<?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“paged=$paged”); ?>
    <?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $count++; ?>

    <div class=”post”>

    <h2 class=”title”>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>

    <?php woo_get_image(‘image’,490,200); ?>

    <div class=”entry”>
    <?php the_content(); ?>
    </div>

    <div class=”post-meta”>

      <li class=”comments”>
      <span class=”head”><?php _e(‘Comments’, ‘woothemes’) ?></span>
      <span class=”body”><?php comments_popup_link(__(‘0 Comments’, ‘woothemes’), __(‘1 Comment’, ‘woothemes’), __(‘% Comments’, ‘woothemes’)); ?></span>

      <li class=”categories”>
      <span class=”head”><?php _e(‘Categories’, ‘woothemes’) ?></span>
      <span class=”body”><?php the_category(‘, ‘) ?></span>

      <li class=”author”>
      <span class=”head”><?php _e(‘Author’, ‘woothemes’) ?></span>
      <span class=”body”><?php the_author_posts_link(); ?></span>

    <div class=”fix”></div>

    </div><!– /.post-meta –>

    </div><!– /.post –>

    <?php endwhile; else: ?>
    <div class=”post”>
    <p><?php _e(‘Sorry, no posts matched your criteria.’, ‘woothemes’) ?></p>
    </div><!– /.post –>
    <?php endif; ?>

    <div class=”more_entries”>
    <?php if (function_exists(‘wp_pagenavi’)) wp_pagenavi(); else { ?>
    <div class=”fl”><?php next_posts_link(__(‘« Older Entries’, ‘woothemes’)) ?></div>
    <div class=”fr”><?php previous_posts_link(__(‘Newer Entries »’, ‘woothemes’)) ?></div>
    <br class=”fix” />
    <?php } ?>
    </div>

    </div><!– /#main –>

    <?php get_sidebar(); ?>

    </div><!– /#content –>

    <?php get_footer(); ?>`

Viewing 3 replies - 1 through 3 (of 3 total)
  • Assuming you posted the appropriate code, you would change this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("paged=$paged"); ?>

    to this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("p=9&paged=$paged"); ?>

    although there really is no need for the paged parameter for only one post.

    Thread Starter goldmember

    (@goldmember)

    thanks. that worked! i really dont even know what the paged parameter is. understanding “the loop” is going to be the death of me.

    Glad it worked! Now, please use the dropdown at top right to mark this topic ‘Resolved’.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘listing only specific post on index.php page’ is closed to new replies.