Site logo

[Resolved] Magazine Grid

Home Forums Support [Resolved] Magazine Grid

Home Forums Support Magazine Grid

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #1895253
    Chaitanya

    Try this code. It works for me

    add_filter( 'pre_get_posts', function( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $offset = 2;
            $ppp = get_option('posts_per_page');
    
            if ( $query->is_paged ) {
                $page_offset = $offset + ( ($query->query_vars['paged']-1) * $ppp );
                $query->set('offset', $page_offset );
            } else {
                $query->set('offset',$offset);
            }
        } else {
            return $query;
        }
    } );
    #1903371
    JOAQUIM GALANTE

    Thank you Chaitanya for your interest in my problem. Solved thanks.

    https://focusmsn.pt

Viewing 2 posts - 16 through 17 (of 17 total)
  • The topic ‘Magazine Grid’ is closed to new replies.