Change "Select a Category" of the Dropdown

This topic has 7 replies, 2 voices, and was last updated 7 years, 2 months ago ago by Rose Tyler

  • Avatar: sergiocosta
    sergiocosta
    Participant
    August 23, 2017 at 12:01

    Hello,

    I would like to change “select a category” to “Any Category”

    I tried to create a code in PHP, but my code doesn’t work. I read a documentation too.

    apply_filters( ‘woocommerce_product_categories_widget_args’,’teste’ );
    function teste( $list_args ) {
    $list_args[‘show_option_all’] = __(‘Any Category’);
    return $list_args;
    }

    My code is wrong?

    Thanks for help.

    6 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 23, 2017 at 15:03

    Hello,

    Could you please provide a screenshot of page where you want to change this text?

    Regards

    Avatar: sergiocosta
    sergiocosta
    Participant
    August 23, 2017 at 15:05

    Check this link:

    https://ibb.co/n4TGMk

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 23, 2017 at 15:23

    Please provide wp-admin access in Private Content.

    Regards

    Avatar: sergiocosta
    sergiocosta
    Participant
    August 23, 2017 at 15:32

    OK.

    Please, contact administrator
    for this information.
    Avatar: sergiocosta
    sergiocosta
    Participant
    August 23, 2017 at 15:34

    In WPML appears in english. We translated for our languages.

    In english we prefer “Any Category”

    Thanks for help 🙂

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 25, 2017 at 07:55

    Hello,

    Please try to use this code in function.php of your child theme:

    add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'et_product_cat_widget' );
    
    function et_product_cat_widget( $args ) {
    global $wp_query;
    
    $args = array(
        'option_select_text' => __( 'Any Category', 'royal' )
        );
    
    return $args;
    }

    Regards

  • Viewing 7 results - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.