Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same problem : https://hpics.li/635a3d7

    The title and the button aren’t in the css style. Hope you find the bug ??

    Thread Starter qhenonh

    (@qhenonh)

    I just found the problem thanks to : https://wordpress.stackexchange.com/questions/176347/pagination-returns-404-after-page-20

    In fact I just have to set posts per page to 6 in admin (it was 20).

    Thread Starter qhenonh

    (@qhenonh)

    I found more explanations.

    The author page displays 6 articles per page.
    In fact, the 404 error page appears on author’s page 2 when the author has less than 20 articles.
    For an author who have 23 articles the 404 error page appears on page 3
    For an author who have 469 articles, the 404 error page appears on page 26

    So it’s like the bug depends of the number of articles, it’s really strange… It’s like the number of pages isn’t well calculated to display all the articles.

    Hope someone can help me ??

    Thread Starter qhenonh

    (@qhenonh)

    But I already have the bug in the author’s pages.
    For some authors it works correctly but for others I have an error 404 when I click on the page 2

    This is the code

    <?php
    get_header();
    $post_options = get_post_meta(get_the_ID(), GT3_THEMESHORT . 'post_options', true);
    $sidebar_position = get_theme_mod('default_sidebar_position');
    if (isset($post_options['posts_in_a_row']) && $post_options['posts_in_a_row'] == 3) {
        $posts_in_row = 3;
        $posts_in_row_span = 4;
    } elseif (isset($post_options['posts_in_a_row']) && $post_options['posts_in_a_row'] == 1) {
        $posts_in_row = 1;
        $posts_in_row_span = 12;
    } else {
        $posts_in_row = 2;
        $posts_in_row_span = 6;
    }
    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
    ?>
        <div class="container content <?php echo $sidebar_position; ?>">
            <div class="row">
    		    <div class="content_block page_titles <?php echo(($sidebar_position == 'right_sidebar' || $sidebar_position == 'left_sidebar') ? 'span9' : 'span12'); ?>">
    
    		    <h1>à propos de l'auteur</h1>
    		    <?php if ( function_exists( 'wpsabox_author_box' ) ) echo wpsabox_author_box(); ?>
    
    		    <h1>Ses dernières contributions</h1>
    		    <br/>
    
                       <?php
    
                    $args = array(
                        'posts_per_page' => ((isset($post_options['posts_count']) && $post_options['posts_count']) ? $post_options['posts_count'] : '6'),
                        'post_type' => 'post',
                        'paged' => $paged,
                        'post_status' => 'publish',
                        'author' => $curauth->ID
                    );
    
                    $wp_query2 = new WP_Query();
                    $wp_query2->query($args);
                    $posti = 1;
                    $posti_all = 1;
    
                    echo '<div class="posts_container clearfix">';
                    while ($wp_query2->have_posts()) {
                        $wp_query2->the_post();
                        if ($posti == 1 && $show_style_class !== 'masonry_style') {
                            echo '<div class="row">';
                        }
                        echo '<div class="help_class span' . $posts_in_row_span . '">';
                        if ($show_style_class == 'masonry_style') {
                            get_template_part('loop-masonry');
                        } else {
                            get_template_part('loop-grid');
                        }
                        echo '</div>';
                        if ($posti >= $posts_in_row && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                            $posti = 0;
                        }
                        if ($posti !== 0 && $posti_all == $wp_query2->post_count && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                        }
                        $posti++;
                        $posti_all++;
                    }
                    echo '</div>';
                    gt3_get_theme_pagination('query2');
                    ?>
    
                </div>
                <?php
                get_sidebar('left');
                get_sidebar('right');
                ?>
            </div>
        </div>
    <?php
    
    get_footer();

    Thread Starter qhenonh

    (@qhenonh)

    I just found the bug ! I have to put : ‘paged’ => $paged,

    <?php
    get_header();
    $post_options = get_post_meta(get_the_ID(), GT3_THEMESHORT . 'post_options', true);
    $sidebar_position = get_theme_mod('default_sidebar_position');
    $posts_in_row = 2;
    $posts_in_row_span = 6;
    ?>
        <div class="container content <?php echo $sidebar_position; ?>">
            <div class="row">
    		    <div class="content_block page_titles <?php echo(($sidebar_position == 'right_sidebar' || $sidebar_position == 'left_sidebar') ? 'span9' : 'span12'); ?>">
    
                       <?php
    
    	            $cats = wp_get_post_categories($post->ID);
                        $args = array(
                        'posts_per_page' => ((isset($post_options['posts_count']) && $post_options['posts_count']) ? $post_options['posts_count'] : '6'),
                        'paged' => $paged,
                        'post_status' => 'publish',
                        'category__and' => $cats
                    );
    
                    $wp_query2 = new WP_Query();
                    $wp_query2->query($args);
                    $posti = 1;
                    $posti_all = 1;
    
                    echo '<div class="posts_container clearfix">';
                    while ($wp_query2->have_posts()) {
                        $wp_query2->the_post();
                        if ($posti == 1 && $show_style_class !== 'masonry_style') {
                            echo '<div class="row">';
                        }
                        echo '<div class="help_class span' . $posts_in_row_span . '">';
                        if ($show_style_class == 'masonry_style') {
                            get_template_part('loop-masonry');
                        } else {
                            get_template_part('loop-grid');
                        }
                        echo '</div>';
                        if ($posti >= $posts_in_row && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                            $posti = 0;
                        }
                        if ($posti !== 0 && $posti_all == $wp_query2->post_count && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                        }
                        $posti++;
                        $posti_all++;
                    }
                    echo '</div>';
                    gt3_get_theme_pagination('query2');
                    ?>
    
                </div>
                <?php
                get_sidebar('left');
                get_sidebar('right');
                ?>
            </div>
        </div>
    <?php
    
    get_footer();

    Thread Starter qhenonh

    (@qhenonh)

    Here is the code of the category.php. I don’t understand where is the bug.

    <?php
    get_header();
    $post_options = get_post_meta(get_the_ID(), GT3_THEMESHORT . 'post_options', true);
    $sidebar_position = get_theme_mod('default_sidebar_position');
    $posts_in_row = 2;
    $posts_in_row_span = 6;
    ?>
        <div class="container content <?php echo $sidebar_position; ?>">
            <div class="row">
    		    <div class="content_block page_titles <?php echo(($sidebar_position == 'right_sidebar' || $sidebar_position == 'left_sidebar') ? 'span9' : 'span12'); ?>">
    
                       <?php
    
    	            $cats = wp_get_post_categories($post->ID);
                    $args = array(
                        'posts_per_page' => ((isset($post_options['posts_count']) && $post_options['posts_count']) ? $post_options['posts_count'] : '6'),
                        'category__and' => $cats
                    );
    
                    $wp_query2 = new WP_Query();
                    $wp_query2->query($args);
                    $posti = 1;
                    $posti_all = 1;
    
                    echo '<div class="posts_container clearfix">';
                    while ($wp_query2->have_posts()) {
                        $wp_query2->the_post();
                        if ($posti == 1 && $show_style_class !== 'masonry_style') {
                            echo '<div class="row">';
                        }
                        echo '<div class="help_class span' . $posts_in_row_span . '">';
                        if ($show_style_class == 'masonry_style') {
                            get_template_part('loop-masonry');
                        } else {
                            get_template_part('loop-grid');
                        }
                        echo '</div>';
                        if ($posti >= $posts_in_row && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                            $posti = 0;
                        }
                        if ($posti !== 0 && $posti_all == $wp_query2->post_count && $show_style_class !== 'masonry_style') {
                            echo '</div>';
                        }
                        $posti++;
                        $posti_all++;
                    }
                    echo '</div>';
                    gt3_get_theme_pagination('query2');
                    ?>
    
                </div>
                <?php
                get_sidebar('left');
                get_sidebar('right');
                ?>
            </div>
        </div>
    <?php
    
    get_footer();
    Thread Starter qhenonh

    (@qhenonh)

    I already try to deactivate all the extensions but the bug remains.

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