• sabinhas83

    (@sabinhas83)


    `
    <?php
    $popularpost = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $args = array (
    ‘post_type’ => array( ‘post’,’reward_style_type’),
    ‘posts_per_page’ => ‘8’,
    ‘meta_key’ => ‘wpb_post_views_count’,
    ‘orderby’ => ‘meta_value_num’,
    ‘order’ => ‘DESC’
    );
    $wp_query = new WP_Query($args);
    ?>

    if i have this loop instance what should be the shortcode?

    https://wordpress.org/plugins/ajax-load-more/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    [ajax_load_more post_type=”post, reward_style_type” posts_per_page=”8″ meta_key=”wpb_post_views_count” orderby=”meta_value_num” order=”DESC”]

    Thread Starter sabinhas83

    (@sabinhas83)

    @dcooney thanks for that. it doesnt work. i have another loop on the same page

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $args = array (
    'post_type' => array( 'post','reward_style_type'),
    'posts_per_page' => '8',
    'paged' => $paged
    );
    $wp_query = new WP_Query($args);
    ?>
    
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

    is it possible to have both loops working on the page or do i need to do something to make it work?

    Plugin Author Darren Cooney

    (@dcooney)

    Is ajax load more running inside that other loop?

    Thread Starter sabinhas83

    (@sabinhas83)

    no both are running out of the loop. because im using the offset option equals to 8…

    Plugin Author Darren Cooney

    (@dcooney)

    Sorry, then i’m not sure.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Difficulty on getting the appropriate shortcode’ is closed to new replies.