reply

Home Forums Responsive Themes Coupon Theme Sort Coupons by Listing Type Reply To: Sort Coupons by Listing Type

  • JamesD
    JamesD
    Super Guru 1,704 points
    May 18, 2019 at 9:58 pm

    @ppt_retaildiscountcodes20-03-19_92369175

    After applying query, the sorting works but why my all the header and styling is disturbed?

    Could be a couple things, like the special characters used to enclose data.

    See if this takes care of the header:
    Change ALL of the special characters and to a regular apostrophe '. They are differently encoded types of characters.
    Note: For future reference, if you see an error message it’s helpful to include that in your posts.

    The way this forum posts data could change them to the special characters, so I’m hoping this displays your code with the proper apostrophes:

    function _custom_order($wp_obj){
    if (!is_admin() && !$wp_obj->is_main_query() && !is_front_page())
    {
    echo 'log';
    $wp_obj->set('meta_key', 'type');
    $wp_obj->set('orderby', 'meta_value');
    $wp_obj->set('order', 'ASC');
    }
    }
    add_action( 'pre_get_posts', array( $this, '_custom_order' ) );
  • New Business Themes for WordPress 2020

    Start your new website today!

    View Business Themes