Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter deafdisaster

    (@deafdisaster)

    Hey, thanks for your help. A sort of combination seems to have worked. Im running this now and everything works fine. I really dont understand why, though.

    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
    			$args= array(
    			 'paged' => $paged,
    			 'posts_per_page' => 4,
    );
    			query_posts($args);

    I dosent seem correct as the get_query_var(‘page’) differ from the ‘paged’ => $paged,

    But it works.

    Thread Starter deafdisaster

    (@deafdisaster)

    Thanks, using ‘page’ instead seems to have solved the page navigation links.

    But the site still loads the same four posts on every page. So when i click “Older posts” the navigation seems to behave correctly and send me to /page/2/ and displays functioning link to /page/3/. But the posts stay the same.

    Heres the current code.

    <?php
    /**
     * Template Name: Grid Page Template
     *
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    		<?php
    			$paged = (get_query_var('page')) ? get_query_var('page') : 1;
    			$args= array(
    			 'page' => $paged,
    			 'posts_per_page' => 4,
    );
    			query_posts($args);
    			if( have_posts() ) :?>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', get_post_format() ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    			<?php twentytwelve_content_nav( 'nav-below' ); ?>
    
    			<?php else : ?>
    			<article id="post-0" class="post no-results not-found">
    				<header class="entry-header">
    					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
    				</header>
    				<div class="entry-content">
    					<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
    					<?php get_search_form(); ?>
    				</div><!-- .entry-content -->
    			</article><!-- #post-0 -->
    
    			<?php endif; wp_reset_query(); ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter deafdisaster

    (@deafdisaster)

    Its not creating any error.log-file, even though i have

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);

    both enabled. And everything else in the installation works fine.

    Thread Starter deafdisaster

    (@deafdisaster)

    I’m developing my site locally with XAMPP on Mac, and as far as i know im not getting any errors.

Viewing 4 replies - 1 through 4 (of 4 total)