Support » Fixing WordPress » posts in the single.php

  • Hello I’m new and I’ve problem with show posts on the curent post for exaplme I have code in single.php:
    (this is the post number f.e ‘p=5’)
    ….
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    /*now i’d like show on this post another post and i do .*/

    <?php if ($post->ID==5) : if(query_posts(‘p=7’)): the_post(); the_content(); endif; endif;?>
    ….

    <?php endwhile; ?><?php endif; ?>

    /*and display me the post number 7 on post 5 – that’s ok*/
    /*but i want display another post also on post 31 and the same code above don’t display me another post contents – > why? */
    /*i’ve treid use “multiple loops” but don’t work */
    /* how add another post contents in this post ? */

Viewing 2 replies - 1 through 2 (of 2 total)
  • Isn’t that an oxymoron? – to have more posts on single.php 😉

    Yes that’s paradox !
    ……
    /*this post appear */
    <?php if ($post->ID==5) : if(query_posts(‘p=7’)): the_post(); the_content(); endif; endif;?>

    /* bottom – this post disapper */
    <?php if ($post->ID==5) : if(query_posts(‘p=23’)): the_post(); the_content(); endif; endif;?>

    /*i want display display the content two post number 7 and 23 on the post 5 – what am i doing wrong ? thanks for advice */

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘posts in the single.php’ is closed to new replies.