• Resolved dti06

    (@dti06)


    Hi,

    I’d like to add a hook in the function.php file of the cl-classified theme to unset some options/arguments for the listing ordering/sorting.

    Can you help please?

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Muhammad Ali Akbar

    (@alireyad)

    Hi,
    Yes, you can do it. Could you mention which options do you want to unset?

    Thank you

    Thread Starter dti06

    (@dti06)

    Hi,

    I’d like to unset:
    – Most viewed
    – Less viewed
    – Price ( high to low )
    – Price ( low to high )
    – A to Z ( title )
    – Z to A ( title )

    And I’d like to have the default order set to “Recently added ( latest )” first.

    Thank you

    Plugin Support Muhammad Ali Akbar

    (@alireyad)

    Hi,
    Okay, add the following code in child theme functions.php file –

    add_filter( 'rtcl_listing_orderby_options', function ( $options ) {
    unset( $options['views-desc'] );
    unset( $options['views-asc'] );
    unset( $options['price-asc'] );
    unset( $options['price-desc'] );
    unset( $options['title-asc'] );
    unset( $options['title-desc'] );

    return $options;
    } );

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.