Your address will show here +12 34 56 78

Home Forums WP ESTATE – Real Estate WordPress Theme FORUM Random – Featured Venues

This topic contains 7 replies, has 2 voices, and was last updated by  javierh 3 years, 5 months ago.

  • Author
    Posts
  • #32427

    Michael

    I have the Featured Restaurants on the main page, but they don’t change. The 1st 4 get shown.
    How can I make them random, so a selection of 4 out of all Featured Restaurants get shown.
    an the same for new entries, how to show 4 out of the last 20 entries???

    Thanks for your help

    Michael
    PS: Restaurants = properties!!! I changed everything to a restaurant review site!

  • #32734

    crerem

    Hello,

    I assume you use the latest listings shortcode for the first page. This shortcode shows the featured listings first.

    To change go to libs/shortcodes.php and at line 1103 change

    $args = array(
    ‘post_type’ => $type,
    ‘post_status’ => ‘publish’,
    ‘paged’ => 0,
    ‘posts_per_page’ => $post_number_total,
    ‘meta_key’ => ‘prop_featured’,
    ‘orderby’ => ‘meta_value ‘,
    ‘order’ => ‘DESC’,
    ‘tax_query’ => array(
    $category_array,
    $action_array,
    $city_array,
    $area_array
    )

    into

    $args = array(
    ‘post_type’ => $type,
    ‘post_status’ => ‘publish’,
    ‘paged’ => 0,
    ‘posts_per_page’ => $post_number_total,
    ‘orderby’ => ‘rand’,
    ‘tax_query’ => array(
    $category_array,
    $action_array,
    $city_array,
    $area_array
    )

    Attention – this will change ALL of these shortcode instances.

    Come back with a link – would love to see how you turn wpestate into a restauran review site 🙂

    Good luck

  • #32860

    Michael

    Hi Crerem
    Thanks for your answer, but I can see a difference. When I refresh the page, the restaurants are still the same. I want to show X NR of Featured venues and a X NR of all venues. (each group random) so that the user doesn’t see always the same restaurants.
    ——————–
    The Site is online: http://www.dinnerclub.co.za (looks great as a restaurant site!)
    ——————–
    There is a bug with the GPS! When you add 2 Venues with the same GPS, you have no chance to see the venues. When they are to close and you reach the max zoom level, you cant say what venue is under the Nr on the map!
    (Is there a max. of Venues to show on the Google map? I want to add ~8000 Venues!)
    ——————–
    The Theme is great!!!
    ——————–

    Here is what I changed!!!

    $args = array(
    ‘post_type’ => $type,
    ‘post_status’ => ‘publish’,
    ‘paged’ => 0,
    ‘posts_per_page’ => $post_number_total,
    ‘meta_key’ => ‘prop_featured’,
    ‘orderby’ => ‘rand ‘,
    ‘order’ => ‘DESC’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘property_category’,
    ‘field’ => ‘term_id’,
    ‘terms’ => $category_of_tax
    )
    )

    );
    }else{
    $args = array(
    ‘post_type’ => $type,
    ‘post_status’ => ‘publish’,
    ‘paged’ => 0,
    ‘posts_per_page’ => $post_number_total,
    ‘meta_key’ => ‘prop_featured’,
    ‘orderby’ => ‘rand’,
    ‘order’ => ‘DESC’,

    );
    }

  • #33058

    Michael

    Rand still doesn’t work! but:
    +++There is a bug with the GPS! When you add 2 Venues with the same GPS, you have no chance to see the venues. When they are to close and you reach the max zoom level, you cant say what venue is under the Nr on the map!+++
    Problem solved= Maximum zoom level for Cloud Cluster to appear!
    ——————

  • #33170

    Patsak

    Hi Michael

    I have been struggling with the same random problem like you, but when I comment in libs/shortcodes.php line 1142

    add_filter( ‘posts_orderby’, ‘my_order’ );

    It works for me, now my properties are random

    😀

  • #33181

    Anna
    Keymaster

    Hi Michael,

    The Cluster Zoom control is the solution I would have recommended as well. I’m happy it worked for you.

    For random lists, please see Patsak’s idea. If you need more help, please let me know.

    Thank you
    Anna

  • #33393

    costaricamulitmedia

    you could use a plugin to pull the list and sort randomly or however the plugin options allow control, as personally go with widgets, like ultimate or flexi posts widget and then shortcode the widget into the page, if needed and/or use in a sidebar as a widget

  • #33402

    javierh

    Could you set it Random finally?
    thank you !

You must be logged in to reply to this topic.