Results 1 to 8 of 8

Thread: How to solve problem with Pagination or “Woops! not found page 404″

  1. #1
    Thread Starter
    Veteran goodwash's Avatar
    Join Date
    Nov 2011
    Location
    Russian Federation
    Posts
    361
    Thanks
    0
    Thanked 79 Times in 73 Posts

    How to solve problem with Pagination or “Woops! not found page 404″

    I see often pagination problem for ClassiPress users. Usualy it’s the problem when you’re redirecting to "Woops! not found page 404"

    How to solve it?

    I want to share good solution for it. You can see how it’s working on sellhairstore.com
    User is able to navigate pages by each tabs.



    Let’s start )

    1 – make backup files index.php and includes/theme-actions.php

    2 – open theme-actions.php and add this code in the end:


    PHP Code:
    PHP Code:
    /**
    * query coupons on homepage in main wp query, fixes pagination
    *
    */
    function clpr_query_coupons_on_homepage$query ) {
    if( 
    $query->is_main_query() && $query->is_home() )
    $query->set'post_type'APP_POST_TYPE );
    }
    if ( 
    version_compare($wp_version'3.4''>=') )
    add_action'pre_get_posts''clpr_query_coupons_on_homepage' ); 
    3 – open index.php and add this code under first line <?php get_header(); ?>

    PHP Code:
    <script type="text/javascript">
    jQuery(document).ready(function(){
    jQuery('.pages a').live('click', function(e){
    e.preventDefault();
    var 
    block jQuery(this).parents('.block').attr('id');
    var 
    href jQuery(this).attr('href');
    jQuery('#' block).animate({
    'opacity''0.3'
    }, 300'linear');
    jQuery('#' block).load(href ' #' block '_cont', function(){
    jQuery(this).animate({
    'opacity''1'
    }, 300'linear');
    });
    });
    });
    </script> 
    4 – make changes below for the same index.php

    Find where <!– tab 1 –> is starting. It’s 'Just Listed' tab on main page. Change there
    PHP Code:
     <div id="block1"
    to
    PHP Code:
    <div id="block1"><div id="block1_cont"
    Then make similar work with tab 2 and tab 3.

    for tab 2 change
    PHP Code:
    <div id="block2"
    to
    PHP Code:
        <div id="block2"><div id="block2_cont"
    For tab 3 change
    PHP Code:
    <div id="block3"
    to
    PHP Code:
    <div id="block3"><div id="block3_cont"
    5 – then you need to add code to show pagination for each tab.
    Find this line and uder you’ll see code

    PHP Code:
    <?php
        
    if( $total_pages ){ ?>
        <div><a href="<?php echo $post_type_url?>page/2/"> <?php _e'View More Ads''appthemes' ); ?> </a></div>
        <?php ?>
    So change this code to

    PHP Code:
    <?php
        
    if( $total_pages ){ ?>
        <div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
        <?php ?>
    It’s for tab 1.

    Go next tab and you can see under the line
    PHP Code:
    <?php get_template_part'loop''featured' ); ?>
    You need the code lines

    PHP Code:
    <?php global $cp_has_next_page?>
        <?php if($cp_has_next_page){ ?>
        <div><a href="<?php echo $post_type_url?>page/2/?sort=popular"> <?php _e'View More Ads''appthemes' ); ?> </a></div>
        <?php ?>
    Chande it to

    PHP Code:
    <?php
        
    if( $total_pages ){ ?>
        <div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
        <?php ?>
    And the end for tab 3: under line
    PHP Code:
    <?php get_template_part'loop''ad_listing' ); ?>
    you’ll see this code:

    PHP Code:
     <?php
        
    if( $total_pages ){ ?>
        <div><a href="<?php echo $post_type_url?>page/2/?sort=random"> <?php _e'View More Ads''appthemes' ); ?> </a></div>
        <?php ?>
    change to

    PHP Code:
     <?php
        
    if( $total_pages ){ ?>
        <div><?php if(function_exists('appthemes_pagination')) appthemes_pagination(); ?></div>
        <?php ?>
    6 – save file and upload to your server.

    Enjoy to use it

  2. The Following 2 Users Say Thank You to goodwash For This Useful Post:

    danmont (February 3rd, 2013), einstein (December 15th, 2012)

  3. #2
    mazza's Avatar
    Join Date
    Jun 2012
    Location
    United Kingdom
    Posts
    194
    Thanks
    21
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Thread Starter
    Veteran goodwash's Avatar
    Join Date
    Nov 2011
    Location
    Russian Federation
    Posts
    361
    Thanks
    0
    Thanked 79 Times in 73 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    Senior Member richard168's Avatar
    Join Date
    Jul 2010
    Location
    Singapore
    Posts
    147
    Thanks
    25
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    Thread Starter
    Veteran goodwash's Avatar
    Join Date
    Nov 2011
    Location
    Russian Federation
    Posts
    361
    Thanks
    0
    Thanked 79 Times in 73 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. The Following User Says Thank You to goodwash For This Useful Post:

    danmont (February 3rd, 2013)

  8. #6
    Senior Member richard168's Avatar
    Join Date
    Jul 2010
    Location
    Singapore
    Posts
    147
    Thanks
    25
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #7
    kenhammond's Avatar
    Join Date
    Apr 2010
    Location
    United States
    Posts
    39
    Thanks
    0
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    danmont's Avatar
    Join Date
    Jul 2011
    Location
    United States
    Posts
    95
    Thanks
    18
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [TUTORIAL] How to solve problem with Pagination or “Woops! not found page 404″
    By goodwash in forum ClassiPress General Discussion
    Replies: 26
    Last Post: September 3rd, 2012, 01:41 PM
  2. [SOLVED] Pagination Problem – Link Back to Page 1 (Home Page) from Another Page Not Working
    By hassledhoff in forum Report ClassiPress Bugs
    Replies: 19
    Last Post: August 25th, 2012, 11:04 PM
  3. Replies: 1
    Last Post: February 29th, 2012, 09:27 AM
  4. Dilemma: how to solve the problem of trust in buying/selling at classified sites
    By ajomalley in forum ClassiPress General Discussion
    Replies: 3
    Last Post: January 9th, 2012, 06:38 PM
  5. The infamous image upload problem (...and how to solve it once and for all)
    By doctorcilantro in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: April 21st, 2011, 11:26 AM