I need to show on single publish three issues:
- Listing of all posts on the whole
- Single publish title
- Content material
What I achieved proper now just isn’t satisfying as a result of I’m displaying all posts (and it really works okay) however the second half (related with displaying solely particular publish title and content material) do not work as a result of it exhibits solely the latest one.
For instance:
I’ve 2 posts referred to as “Information about IT” and “TV collection”. Publish about TV is the latest one. After clicking on Information about IT i’ll see all posts within the prime and as a important half – title and content material of NEWS ABOUT IT. Proper now utilizing my resolution it exhibits TV collection as a latest publish..
How can I obtain my resolution?
That is my present code:
<div class="wrapper">
<div class="middle">
<div class="sub-menu-1">
<a href="#" title="O nas" class="about-us"> O nas </a>
<a href="#" title="Oferta" class="provide"> 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=publish&posts_per_page=-1'); ?>
<?php if(have_posts()) : whereas(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=publish&posts_per_page=1'); ?>
<?php if(have_posts()) : whereas(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="observe">
<div class="thumb">
<div class="finish"></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>