New Landing How can we help? Themeforest Theme Support Neighborhood 404 category pagination problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • #12545
    Visual Jack
    Member
    Post count: 8

    Error 404 on pagination when changing page:

    http://www.tatiaraujo.com/category/works/

    i’m using the following code on the top of category.php

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    $current_cat = get_query_var( 'cat' );
    $args = array(
    'orderby' => 'rand',
    'cat' => $current_cat,
    'posts_per_page' => 12,
    );
    query_posts($args);
    
    ?>	

    thanks.

    #12548
    Visual Jack
    Member
    Post count: 8

    FIXED

    remove from the top of file category.php the previous code and insert the following in the function.php:

    `
    <?php

    function my_post_queries( $query ) {
    // do not alter the query on wp-admin pages and only alter it if it’s the main query
    if (!is_admin() && $query->is_main_query()){

    // alter the query for the home and category pages

    if(is_home()){
    $query->set(‘posts_per_page’, 3);
    }

    if(is_category()){
    $query->set(‘posts_per_page’, 3);
    }

    }
    }
    add_action( ‘pre_get_posts’, ‘my_post_queries’ );

    ?>

    #12625
    Visual Jack
    Member
    Post count: 8

    the problem actually is not resolved. if i use the previous code the pagination works fine but i cant access in any way at wp dashboard because the functions.php of the child theme with the previous code causes fatal error.

    any idea to fix it?

    please help, i want i simply paginations for category pages!

    thank you on advance!

    #12635
    Ben – SUPPORT
    Member
    Post count: 690

    Hey,

    What seems to be the error when you add the code?

    Please bear in mine our support contract doesn’t cover custom work

    Thanks
    Ben

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

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register