Skip to main content
moving code inside answer
Source Link
jgraup
  • 9.8k
  • 3
  • 32
  • 68

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post twothree things:

  • listList of ALLall posts in general
  • singleSingle post title
  • contentContent

What I achieved right now is not satisfingsatisfying because I AMam displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - because it shows only the newest one;/ So giving it into realone.

For example:

how toHow can I achieve my solution?

This is my current code:

<div class="wrapper">

    <div class="center">
        <div class="sub-menu-1">
            <a href="#" title="O nas" class="about-us"> O nas </a>
            <a href="#" title="Oferta" class="offer"> Oferta</a>
            <div class="clear"></div>
        </div>

        <div class="news-slider">
            <a href="#" title="Nowsze wpisy" class="arrow-left" id="mycarousel-prev"></a>

            <div class="news-content">

                <ul id="mycarousel" class="jcarousel-skin-tango">
                    <?php rewind_posts(); ?>
                    <?php query_posts('post_type=post&posts_per_page=-1'); ?>
                    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
                        <li>
                            <p class="post-date"><?php the_time('j F Y') ?></p>
                            <p class="separator"></p>
                            <p class="post-title"><a href="<?php the_permalink(); ?>"
                                                     title="<?php printf(esc_attr__('Odsyłacz do %s', 'sp3-rybnik'), the_title_attribute('echo=0')); ?>"
                                                     rel="bookmark"><?php the_title(); ?></a></p>
                        </li>

                    <?php endwhile;
                    else: ?>
                        <?php wp_reset_query(); ?>
                        <h4>404 - brak strony...</h4>
                        <p>Wielka otchłań internetu połknęła wskazaną stronę - wyszukaj interesującą Cię treść
                            korzystając z
                            menu.</p>
                    <?php endif; ?>

                </ul>

            </div>

            <a href="#" title="Starsze wpisy" class="arrow-right" id="mycarousel-next"></a>

            <div class="clear"></div>
        </div>
    </div>

</div>

<div class="content-single">
    <div class="content-single-entry">
        <?php rewind_posts(); ?>
        <?php query_posts('post_type=post&posts_per_page=1'); ?>
        <?php if(have_posts()) : while(have_posts()) :
        the_post(); ?>
        <h2><?php the_title(); ?></h2>
        <p class="separator"></p>
        <p class="post-date"><?php the_time('j F Y') ?></p>


        <div id="scrollbar1">
            <div class="scrollbar">
                <div class="track">
                    <div class="thumb">
                        <div class="end"></div>
                    </div>
                </div>
            </div>
            <div class="viewport">
                <div class="overview">

                    <?php the_content(); ?>
                    <?php endwhile;
                    else: ?>
                        <?php wp_reset_query(); ?>
                        <h4>404 -brak strony...</h4>
                        <p>Wielka otchłań internetu połknęła wskazaną stronę - wyszukaj interesującą Cię treść
                            korzystając z menu.</p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post two things:

  • list of ALL posts in general
  • single post title
  • content

What I achieved right now is not satisfing because I AM displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - it shows only the newest one;/ So giving it into real example:

how to achieve my solution?

I want to display on single post three things:

  • List of all posts in general
  • Single post title
  • Content

What I achieved right now is not satisfying because I am displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work because it shows only the newest one.

For example:

How can I achieve my solution?

This is my current code:

<div class="wrapper">

    <div class="center">
        <div class="sub-menu-1">
            <a href="#" title="O nas" class="about-us"> O nas </a>
            <a href="#" title="Oferta" class="offer"> Oferta</a>
            <div class="clear"></div>
        </div>

        <div class="news-slider">
            <a href="#" title="Nowsze wpisy" class="arrow-left" id="mycarousel-prev"></a>

            <div class="news-content">

                <ul id="mycarousel" class="jcarousel-skin-tango">
                    <?php rewind_posts(); ?>
                    <?php query_posts('post_type=post&posts_per_page=-1'); ?>
                    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
                        <li>
                            <p class="post-date"><?php the_time('j F Y') ?></p>
                            <p class="separator"></p>
                            <p class="post-title"><a href="<?php the_permalink(); ?>"
                                                     title="<?php printf(esc_attr__('Odsyłacz do %s', 'sp3-rybnik'), the_title_attribute('echo=0')); ?>"
                                                     rel="bookmark"><?php the_title(); ?></a></p>
                        </li>

                    <?php endwhile;
                    else: ?>
                        <?php wp_reset_query(); ?>
                        <h4>404 - brak strony...</h4>
                        <p>Wielka otchłań internetu połknęła wskazaną stronę - wyszukaj interesującą Cię treść
                            korzystając z
                            menu.</p>
                    <?php endif; ?>

                </ul>

            </div>

            <a href="#" title="Starsze wpisy" class="arrow-right" id="mycarousel-next"></a>

            <div class="clear"></div>
        </div>
    </div>

</div>

<div class="content-single">
    <div class="content-single-entry">
        <?php rewind_posts(); ?>
        <?php query_posts('post_type=post&posts_per_page=1'); ?>
        <?php if(have_posts()) : while(have_posts()) :
        the_post(); ?>
        <h2><?php the_title(); ?></h2>
        <p class="separator"></p>
        <p class="post-date"><?php the_time('j F Y') ?></p>


        <div id="scrollbar1">
            <div class="scrollbar">
                <div class="track">
                    <div class="thumb">
                        <div class="end"></div>
                    </div>
                </div>
            </div>
            <div class="viewport">
                <div class="overview">

                    <?php the_content(); ?>
                    <?php endwhile;
                    else: ?>
                        <?php wp_reset_query(); ?>
                        <h4>404 -brak strony...</h4>
                        <p>Wielka otchłań internetu połknęła wskazaną stronę - wyszukaj interesującą Cię treść
                            korzystając z menu.</p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>
formatted the list
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post two things:

  • list of ALL posts in general
  • single post title + 
  • content

What I achieved right now is not satisfing because I AM displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - it shows only the newest one;/ So giving it into real example:

I have 2 posts called "News about IT" and "TV series". Post about TV is the newest one. After clicking on News about IT i will see all posts in the top and as a main part - title and content of NEWS ABOUT IT. Right now using my solution it shows TV series as a newest post..

how to achieve my solution?

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post two things:

  • list of ALL posts in general
  • single post title + content

What I achieved right now is not satisfing because I AM displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - it shows only the newest one;/ So giving it into real example:

I have 2 posts called "News about IT" and "TV series". Post about TV is the newest one. After clicking on News about IT i will see all posts in the top and as a main part - title and content of NEWS ABOUT IT. Right now using my solution it shows TV series as a newest post..

how to achieve my solution?

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post two things:

  • list of ALL posts in general
  • single post title 
  • content

What I achieved right now is not satisfing because I AM displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - it shows only the newest one;/ So giving it into real example:

I have 2 posts called "News about IT" and "TV series". Post about TV is the newest one. After clicking on News about IT i will see all posts in the top and as a main part - title and content of NEWS ABOUT IT. Right now using my solution it shows TV series as a newest post..

how to achieve my solution?

Source Link

Single post - display list of all posts + specific post

my single post looks like that: http://pastebin.com/KdEbs82P

I want to display on single post two things:

  • list of ALL posts in general
  • single post title + content

What I achieved right now is not satisfing because I AM displaying all posts (and it works ok) but the second part (connected with showing only specific post title and content) don't work. By don't work I mean - it shows only the newest one;/ So giving it into real example:

I have 2 posts called "News about IT" and "TV series". Post about TV is the newest one. After clicking on News about IT i will see all posts in the top and as a main part - title and content of NEWS ABOUT IT. Right now using my solution it shows TV series as a newest post..

how to achieve my solution?