WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I get the Word Press function “wp_link_pages” working? (2 posts)

  1. rocketman7k
    Member
    Posted 3 years ago #

    I purchased a theme and it doesn't create links to pages when I insert the short tag <!--nextpage-->.

    According to the WP Codex I need to have this code:
    <?php wp_link_pages(); ?> in The Loop.

    Here is the templates index page which contains The Loop:

    <div id="the_body">
        <?php dynamic_sidebar(2);  ?>
        <div class="clearboth"></div>
    
    <?php if (get_option('uniq_homepage_content')) { ?>
        <?php wp_reset_query(); ?>
        <?php if(have_posts()) : $scounter=0; ?>
      <?php while(have_posts()) : the_post() ?>
      <?php $scounter++; ?>
      <?php $post_images = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); ?>
    
        <div id="post-<?php the_ID(); ?>" class="posts_small <?php if ($scounter==1) echo 'first_small'; ?>">
            <?php if ($post_images[0]) { ?>
                <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="preloader"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo $post_images[0];?>&w=200&h=200&zc=1&q=80<?php echo $thumb_url;?>" alt="<?php the_title(); ?>"  class="mag fade_hover preloader" /></a>
            <?php } ?>
    
            <div class="post_content">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                <p class="meta">By <?php the_author_posts_link(); ?> | <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> | <a href="<?php the_permalink(); ?>#commentarea"><?php comments_number('No comments', 'One comment', '% comments'); ?></a></p>
                <p><?php echo bm_better_excerpt(280, '...'); ?></p>
                <p class="tags">Posted in: <span class="category"><?php the_category(", "); ?> </span></p>
            </div>
    
        </div>  
    
      <?php endwhile; ?>
    
        <div class="pagination">
            <?php if (function_exists('wp_pagenavi')) { ?>
                <?php wp_pagenavi(); ?>
            <?php } ?>
        </div>
    <?php endif; } ?>
    </div> <!-- the_body -->
    
    <?php get_sidebar(); ?>

    I put the code snippet in the loop in various place (thinking it might make a difference), but was still not able to get the page links to appear at the bottom of the post.

    Is there something in this page that is preventing the wp_link_pages function from working?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    have you checked if your theme has a page.php for the static pages ,and a single.php for the single posts?

    you may need to make the changes in these templates as well.

    for more help you could try to contact the theme vendor.

Topic Closed

This topic has been closed to new replies.

About this Topic