Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: 404 category pagination problem #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!

    in reply to: 404 category pagination problem #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’ );

    ?>

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