Results 1 to 2 of 2

Thread: Paging not working

  1. #1
    Thread Starter
    Senior Member gr8job's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    108
    Thanks
    16
    Thanked 5 Times in 4 Posts

    Paging not working

    Below is the code for a template created from the Latest Jobs template, called Jobs by Date

    Even though it seems to have the correct code for pagination near the end, when I click on the "Next Page" link, it reports Sorry, Nothing was Found, when looking for the page 2 url (jobs-by-date/page/2/). There are plenty of jobs in the database, enough for three pages. Can anyone suggest how I can make this work ? In all the other job-listing pages, pagination works fine.

    Code:
    <?php
    /*
    * Template Name: Jobs by date
    */  
    ?>
    
    <?php
    if (isset($_GET['show'])) $show = $_GET['show'];
    if (!$show) wp_redirect(get_bloginfo('url'));
    ?>
    
    <?php 
    	get_header('search'); get_template_part('includes/featured-jobs');
    	
    	do_action('jobs_will_display'); 
    
    	do_action('before_jobs_by_date', 'date',  $show);
    ?>
    
    	<div class="section">
    
    		<?php
    		$dateargs = array();
    		$title = '';
    		$today = getdate();
    		
    		switch ($show) :
    			case "week" :
    				$title = __('This weeks Jobs','appthemes');
    				$dateargs = array( 'year' => $today["year"], 'w' => date('W') );
    			break;
    			case "lastweek" :
    				$title = __('Last weeks Jobs','appthemes');
    				$week = date('W');
    				$year = $today["year"];
    				if ($week==0) :
    					$week = 53;
    					$year = $year-1;
    				else :
    					$week = $week-1;
    				endif;
    				$dateargs = array( 'year' => $year, 'w' => $week );
    			break;
    			case "today" :
    				$title = __('Todays Jobs','appthemes');
    				$dateargs = array( 'year' => $today["year"], 'monthnum' => $today["mon"], 'day' => $today["mday"] );
    			break;
    			case "month" :
    				$title = __('This Months Jobs','appthemes');
    				$dateargs = array( 'year' => $today["year"], 'monthnum' => $today["mon"] );
    			break;
    		endswitch;
    		
    		$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		$args = array(
    			'post_type'	=> 'job_listing',
    			'post_status' => 'publish',
    			'ignore_sticky_posts'	=> 1,
    			'paged'=>$paged
    		);
    		$args = array_merge($dateargs, $args);
    		query_posts($args);
    		?>
    
    		<h1 class="pagetitle"><?php echo $title; ?></h1>
    
    		<?php get_template_part( 'loop', 'job' ); ?>
    
    		<?php jr_paging(); ?>
    
    		<div class="clear"></div>
    
    	</div><!-- end section -->
    
    	<div class="clear"></div>
    
    </div><!-- end main content -->
    
    <?php if (get_option('jr_show_sidebar')!=='no') get_sidebar(); ?>
    
    <?php get_footer(); ?>

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,703
    Thanks
    166
    Thanked 3,390 Times in 3,261 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Plugins vs CP upgrades (Working vs Not working)
    By Fanatic in forum Report ClassiPress Bugs
    Replies: 60
    Last Post: May 18th, 2012, 05:06 PM
  2. [TUTORIAL] Part One: Change 2nd, 3rd, etc Ads paging to "View more Ads"
    By vienna in forum ClassiPress General Discussion
    Replies: 7
    Last Post: February 6th, 2012, 07:40 PM
  3. Replies: 1
    Last Post: December 16th, 2011, 09:05 AM
  4. Change nav arrow siez in div.paging
    By theecotrader in forum ClassiPress General Discussion
    Replies: 9
    Last Post: March 22nd, 2011, 12:35 PM