WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-Paginate] query post showing next page of tagged posts (2 posts)

  1. callender
    Member
    Posted 2 years ago #

    Hi there,

    I'm developing a site where the client wants everything tagged 'story' to be displayed on the homepage.

    I have created the php code for the loop - below, which also shows wp-pagination:

    <div id="container">
    		<div id="content">
    		<?php if (have_posts()) : ?>
         	<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("tag=story&showposts=5"); ?>
            <?php while (have_posts()) : the_post(); ?>
    		<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
        	<h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    		<div class="thumb-contain"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail();?></a></div>
    		<div class="entry-content"><?php thematic_content(); ?>
    		 <a href="<?php the_permalink(); ?>" class="more-link">Read more</a>
    		</div>
    			<div id="meta-contain">
    				<div class="post-comments"><a href="<?php comments_link(); ?>"><?php comments_number('<span>0 Comments</span>','<span>1 Comment</span>','<span>% Comments</span>'); ?></a> </div>
    			</div><!-- end meta contain -->
    		</div> <!-- end post -->
    <?php endwhile; endif; ?>
    
    <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
    		</div><!-- #content -->
    	</div><!-- #container -->

    However, when clicking on the pagination the following url is created:

    http://www.websitename.com/page/2/

    >> needs to be http://www.websitename.com/tag/story/page/2/

    This obviously leads to a 404. How can I add to the code to insert /tag/story before the /page so that it works..

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

    Can extra code be added to this?

    Many thanks for your help

    Jim

  2. callender
    Member
    Posted 2 years ago #

    hi any thoughts on this one?

Topic Closed

This topic has been closed to new replies.

About this Topic