WordPress.org

Ready to get started?Download WordPress

Forums

posts in the single.php (3 posts)

  1. marhoff
    Member
    Posted 8 years ago #

    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 ? */

  2. moshu
    Member
    Posted 8 years ago #

    Isn't that an oxymoron? - to have more posts on single.php ;)

  3. marhoff
    Member
    Posted 8 years ago #

    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 */

Topic Closed

This topic has been closed to new replies.

About this Topic