• Hello ,

    I didnt find any help on their website so i hope to find it here, my question is how to increase the amount of posts in this particular code snippet -> <?php while ( have_posts() ) : the_post(); ?> i guess that this is the output
    <?php if( have_posts() ) : ?> -> and this can be used to controll the output

    Thank you in advance

    <?php do_action( ‘wpbf_main_content_open’ ); ?>
    <?php if( have_posts() ) : ?>
    <?php wpbf_archive_header(); ?>
    <?php do_action( ‘wpbf_before_loop’ ); ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( ‘inc/template-parts/article’ ); ?>
    <?php endwhile; ?>
    <?php do_action( ‘wpbf_after_loop’ ); ?>
    <?php else : ?>
    <?php get_template_part( ‘inc/template-parts/article-none’ ); ?>
    <?php endif; ?>
    <?php do_action( ‘wpbf_main_content_close’ ); ?>

    • This topic was modified 3 years, 7 months ago by jinegev.
Viewing 2 replies - 1 through 2 (of 2 total)
  • I think this is a main query. We can modify the main query parameter by using pre_get_post hook.

    https://wordpress.stackexchange.com/questions/47683/using-pre-get-posts-to-set-posts-per-page-how-do-i

    Thread Starter jinegev

    (@jinegev)

    Thank you !!! who thought that all you need is 1 line like $query->set(‘posts_per_page’, xxx); in functions php

    here is a solution

    add_action( ‘pre_get_posts’, ‘my_change_sort_order’);
    function my_change_sort_order($query){
    if(is_archive()):
    is_post_type_archive( $post_type )
    //Set the order ASC or DESC
    $query->set( ‘order’, ‘ASC’ );
    //Set the orderby
    $query->set( ‘orderby’, ‘title’ );
    //Set the amount of post
    $query->set(‘posts_per_page’, xxx);
    endif;
    };`

    • This reply was modified 3 years, 7 months ago by jinegev.
    • This reply was modified 3 years, 7 months ago by jinegev.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagebuilder Framework Query Question’ is closed to new replies.