Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter redisztribucio

    (@redisztribucio)

    I resolved. I have changed in the class.yith-wcbr.php file.

    Plugin Author YITHEMES

    (@yithemes)

    Hi redisztribucio,

    I’m sorry for my late response; I hope this answer will still help you

    I’d avoid to change plugin’s files directly
    Indeed, I’d rather use yith_wcbr_taxonomy_rewrite filter, that lets you customize rewrite slug for brand taxonomy

    EG, you could add something similar to functions.php file of your theme

    if( defined( 'YITH_WCBR' ) && ! function_exists( 'yith_wcbr_change_rewrite_rule' ) ){
        function yith_wcbr_change_rewrite_rule( $rewrite ){
            return 'something';
        }
        add_filter( 'yith_wcbr_taxonomy_rewrite', 'yith_wcbr_change_rewrite_rule' );
    }

    Please, don’t forget to regenerate your permalinks after you added this code, simply navigating to WP Dashboard -> Settings -> Permalinks and saving your options as they are

    Have a nice day ??

    Mr. W

    (@gabriel-winnberg)

    Do I need a special rewrite rule for Nginx for this to work?

    • This reply was modified 8 years ago by Mr. W.
    Watch Teller

    (@watchteller)

    Backup and then try as following:

    Please change line 123-125 of wp-content/plugins/yith-woocommerce-brands-add-on/include/class.yith-wcbr.php

    'slug' => apply_filters( 'yith_wcbr_taxonomy_rewrite', 'xxxxx' ),
    'hierarchical' => true,
    'with_front' => apply_filters( 'yith_wcbr_taxonomy_with_front', true )

    ***change the xxxxx to anything you like.

    Change again every update.

    Mr. W

    (@gabriel-winnberg)

    This works, thanks!
    But can it be added it via functions.php?

    Watch Teller

    (@watchteller)

    I’m still waiting the plugin developer to update the snippets for function.php

    Subscribe this thread will do.

    Hope very soon (free plugin)

    ^.^

    Mr. W

    (@gabriel-winnberg)

    I got it to work using the snippet above plus the snippet from here:
    https://www.ads-software.com/support/topic/brand-slugs/#post-8427732

    Change ‘custom-brands-slug’ to whatever and add to functions.php:

    // Remove Brands base
    add_filter( ‘yith_wcbr_taxonomy_with_front’, ‘__return_false’ );

    // Rename Brands slug
    if( defined( ‘YITH_WCBR’ ) && ! function_exists( ‘yith_wcbr_change_rewrite_rule’ ) ){
    function yith_wcbr_change_rewrite_rule( $rewrite ){
    return ‘custom-brands-slug’;
    }
    add_filter( ‘yith_wcbr_taxonomy_rewrite’, ‘yith_wcbr_change_rewrite_rule’ );
    }

    Watch Teller

    (@watchteller)

    Wow… thanks you very much… much…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Rename URL’ is closed to new replies.