Change result per page

  • In Progress
    Posted in: EventBuilder  

  • Member
    eveent
    February 9, 2018 at 10:25 am #20814

    Hi,
    I would to change the number of post per page fo some pages.
    I tried to edit the files
    templates/template-all-events.php row 949 and 1228
    templates/template-past-events.php row 866 and 1145
    in this way:

    global $custom_posts2;
    $custom_posts2 = new WP_Query();
    $custom_posts2->query(array(
    ‘s’ => $keyword,
    ‘post_type’ => ‘event’,
    ‘posts_per_page’ => ’20’,
    ‘post_status’ => ‘publish’,
    ‘meta_key’ => ‘event_start_date_number’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘ASC’,
    ‘event_cat’ => $cat,
    ‘event_loc’ => $loc,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘event_status’,
    ‘value’ => ‘upcoming’,
    ),
    $time_args,
    ),
    )
    );

    the code works only for the first page of loop.
    In the second page return to 30 results.
    What is the correct code?

    • This topic was modified 2 weeks by  eveent.
    • This topic was modified 2 weeks by  eveent.

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.