Support » Fixing WordPress » Page Navigation not working on Single Post

  • on my website named http://1234christmas.com single post page does not show page navigation options.

    what things are to be added in existing wordpress single.php code please tell me

    Cdde is pasted below –

    <?php
    get_header();
    ?>
    <!-- begin col left -->
    	<div id="colLeft">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<!-- blog item -->
    				<div class="blogItem">
    					<div class="postMeta">
    						<div class="date"><?php the_time('M') ?> <span><?php the_time('j') ?></span></div>
    						<h1><a>"><?php the_title(); ?></a></h1>
    						<p><img src="<?php bloginfo('template_url'); ?>/images/bell_meta.png" alt=""/> Posted in <?php the_category(', ') ?> by <?php the_author() ?></p>
    					</div>
    <div style="float:left; padding-top:0px; padding-right:15px;">
    Adsense code
    </div>
    					<?php
    $paragraphAfter= 5; //display after the first paragraph
    $content = apply_filters('the_content', get_the_content());
    $content = explode("</p>", $content);
    for ($i = 0; $i <count($content); $i++) {
    if ($i == $paragraphAfter) { ?>
    <div>
    
    <p align="center">
    Adsense Code</p>
    </div>
    
    <?php
    }
    echo $content[$i] . "</p>";
    } ?>
    
    				</div>
    
    <h3>Latest Articles</h3>
    <br \>
    
    <ul>
    <li><?php wp_get_archives('type=postbypost&limit=10'); ?></li>
    </ul>
    				<!-- end blog item -->
    
            <?php endwhile; else: ?>
    
    		<p>Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    
    			</div>
    			<!-- end col left -->
    
    <!-- begin col right -->
    		<div id="colRight" class="clearfix">
    			<?php get_sidebar(); ?>
    		</div>
    		<!-- end col right -->
    
    <?php get_footer(); ?>


    [Please use the code buttons when posting code here]

    ————————

    Please help me guys ….

Viewing 15 replies - 1 through 15 (of 22 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Can you contact your theme’s vendors regarding support for their products?

    Please do not continue posting in other threads – these forums do not work that way.

    i cant contact vendor it is free theme…please help me guys you all here are brilliant people.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    If your theme’s vendors do not provide support for their themes, ditch the theme and use a theme distributed on WordPress.org instead. We don’t provide support for themes not distributed on WordPress.org.

    What is the pagination code in the other templates? Have you tried copying it to the single.php?

    BTW, always make sure you have a backup of your files before changing anything like this AND any file changes you make may be lost when the theme is updated.

    i tried copying the code <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

    and also tried adding this –

    <div class="navigation">
    <div class="alignleft"><?php next_post_link('Newer: %link') ?></div>
    <div class="alignright"><?php previous_post_link('Older: %link') ?></div>
    </div>

    but none worked

    What is the code of the template that works? Please be sure to use the code buttons when posting code here.

    i dont know what code to put in Single.php so that i get older post and newer post links at the end of a single post.

    Does the theme have that kind of pagination on any other templates (pages)?

    how to i come to know about it, where to check that …

    What template is used on the front page or any other page where the pagination shows up as you want?

    in the index file there is a code as follows –

    <?php get_header();
    		<!-- begin colLeft -->
    		<div id="colLeft">
    		<!-- archive-title -->
    						<?php if(is_month()) { ?>
    						<div id="archive-title">
    						Browsing all articles from <strong><?php the_time('F, Y') ?></strong>
    						</div>
    						<?php } ?>
    						<?php if(is_category()) { ?>
    						<div id="archive-title">
    						<?php echo category_description( $category_id ); ?>
    						Browsing all articles in <strong><?php $current_category = single_cat_title("", true); ?></strong>
    						</div>
    						<?php } ?>
    						<?php if(is_tag()) { ?>
    						<div id="archive-title">
    						Browsing all articles tagged with <strong><?php wp_title('',true,''); ?></strong>
    						</div>
    						<?php } ?>
    						<?php if(is_author()) { ?>
    						<div id="archive-title">
    						Browsing all articles by <strong><?php wp_title('',true,''); ?></strong>
    						</div>
    						<?php } ?>
    		<!-- /archive-title -->
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<!-- blog item -->
    				<div class="blogItem">
    					<div class="postMeta">
    						<div class="date"><?php the_time('M') ?> <span><?php the_time('j') ?></span></div>
    						<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    						<p><img src="<?php bloginfo('template_url'); ?>/images/bell_meta.png" alt=""/> Posted in <?php the_category(', ') ?> by <?php the_author() ?></p>
    					</div>
    					<?php the_excerpt(); ?><a href="<?php the_permalink(); ?>">For Full Story Click Here ...</a>
    
    				</div>
    				<!-- end blog item -->
    
    		<?php endwhile; ?>
    
    		<!--<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('Older') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer') ?></div>
    		</div> -->
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>  
    
    	<?php else : ?>
    
    		<p>Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    		</div>
    		<!-- end colLeft -->
    
    <!-- begin colRight -->
    		<div id="colRight">
    			<?php get_sidebar(); ?>
    			</div>
    <!-- end colRight -->
    
    <?php get_footer(); ?>

    this is the portion in above code which i added and it worked in index.php

    <!--<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('Older') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer') ?></div>
    		</div> -->

    but when i add same also in single.php it does not work

    No that code is not what is working – it’s commented out – it’s not being read at all. Try this:

    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Page Navigation not working on Single Post’ is closed to new replies.