Not Working As Intended
-
I have been trying to get this to work with a custom bit of code, the code is shows posts of the category of which the title is (eg. title page is sushi, the page will then list posts from that category only) but i have been unable to add the array into the code, so that it still works as intended but allows the pagination to work also.
The code works like this: http://simconnection.net/the-sims-4-news/ and I dont’ want that too change, but when i click the numbers down the bottom the same content is shown.
Code:
<?php /*
Template Name: ListPostsInCategoryThatHasSameNameAsPage
*/ ?><?php get_header(); ?>
<div id=”content”>
<div id=”main”><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; else: endif; ?><?php query_posts(‘category_name=’.get_the_title().’&post_status=publish,future’); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail( ‘large’, array( ‘class’ => ‘aligncenter’ ) ); ?>
<center><h2 class=”sc-archive-title”>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h2></center>
<center><?php the_excerpt( ‘class=aligncenter’); ?></center><hr />
<?php endwhile; else: endif; ?>
<?php wp_pagenavi(); ?></div>
</div><?php get_footer(); ?>
The code was found on wordpress forum and i tickered with it a bit just to get it set up how i like, but i was unable to get it too use pagination. I found this plugin and i have been trying to get it to work properly but can’t.
Any help would be greatly appreciated.
The topic ‘Not Working As Intended’ is closed to new replies.