Sort by featured

WordPress Business Themes Forums Responsive Themes Coupon Theme Sort by featured Reply To: Sort by featured

Discontinued - The forum content is out of date. For theme support please use our support desk here.

WordPress Business Themes Forums Responsive Themes Coupon Theme Sort by featured Reply To: Sort by featured

  • JamesD
    JamesD
    Super Guru 1,345 points

    @Chris

    Any way to just target expired listings like is done to add “expired” class?

    You’ll need to loop through all the results in the page you want to add the classname (within what ever template file you’re referring to).

    Do you know how to isolate the per page to only main content listings?

    To change per-post on front page only:
    add_action( 'pre_get_posts', '_custom_front_perpage');
    function _custom_front_perpage($wp_obj){
    if( is_front_page() && !is_admin() && !$wp_obj->is_feed() && $wp_obj->is_main_query()) {
    $wp_obj->set('posts_per_page', -1);
    }
    }

    Note: -1 = all listings
    (I’ve added a couple more conditions above)
    Here’s a list of conditions that may help for various scenarios:
    https://codex.wordpress.org/Conditional_Tags

    April 3, 2019 at 10:53 pm
  • Didn't find what you were after?

    Chat with us now

    or contact our support team