• animone
    December 12, 2014 at 1:02 pm #101198

    Hi everyone,

    i have been able to tweak the code to get what’s in topic title.

    It’s a function i needed because i prefer automatic random order for Featured Properties, instead of chronological order (as it is now). I think it’s fair for those paying to have their listings displayed as featured.

    BEFORE PROCEEDING, REMEMBER THAT YOU ARE GOING TO MODIFY THE CODE, AND WITH NEW UPDATES, YOU HAVE TO START ALL OVER AGAIN.

    So, based on my experience, keep note of the changes in a separate text file.

    File to modify: \libs\shortcode.php

    Line 166: ‘orderby’ => ‘meta_value’, change into ‘orderby’ => ‘rand ‘,

    Line 211: add_filter( ‘posts_orderby’, ‘wpestate_my_order’ ); change into add_filter( ‘posts_orderby’ );

    Line 214: add_filter( ‘posts_orderby’, ‘wpestate_my_order’ ); change into add_filter( ‘posts_orderby’ );

    Now, every time the page is refreshed or re-loaded, Fetured Listings are randomized.

    Hope it’s clear.

    Thank you

    • This topic was modified 2 years, 7 months ago by  animone.
    Roxana
    December 12, 2014 at 3:49 pm #101207

    Hi,

    Thank you for sharing this with us.

    Roxana

    danhazard
    February 17, 2015 at 9:08 pm #102957

    ok, I did that – and I get a couple errors:

    Warning: Missing argument 2 for add_filter(), called in /home/content/25/3919125/html/wp/wp-content/themes/wpresidence/libs/shortcodes.php on line 211 and defined in /home/content/25/3919125/html/wp/wp-includes/plugin.php on line 81

    Warning: Missing argument 2 for remove_filter(), called in /home/content/25/3919125/html/wp/wp-content/themes/wpresidence/libs/shortcodes.php on line 214 and defined in /home/content/25/3919125/html/wp/wp-includes/plugin.php on line 296

    http://kelleysisland.com/wp/

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.