Viewing 8 replies - 1 through 8 (of 8 total)
  • Mr. W

    (@gabriel-winnberg)

    I have the same issue. For the site in question I’ve added “/blog/” to the blog entry permalink structure, to separate blog articles from products. It seems PWB uses this permalink structure rather than the shop structure, where for example product categories show like “example.com/productcategory/category-name” and not “example.com/blog/productcategory/category-name”.

    Why doesn’t PWB use the normal shop permalink structure?

    Thanks for the solution, but it’s an annoyance having to manually edit the plugin at each update.

    I don’t even know if it’s relevant, but did you try the new option “Brands page id for linking breadcrumbs” that I mention here?
    https://wordpress.org/support/topic/brands-page-id-for-linking-breadcrumbs-how-does-it-work/

    Array
    (
        [home_url] => https://www.example.com
        [site_url] => https://www.example.com
        [version] => 3.5.3
        [wp_version] => 5.0.2
        [wp_multisite] => 
        [wp_memory_limit] => 256M
        [wp_debug_mode] => 
        [wp_cron] => 1
        [language] => en_US
        [server_info] => nginx/1.10.3
        [php_version] => 7.0.32-0ubuntu0.16.04.1
        [php_post_max_size] => 96M
        [php_max_execution_time] => 300
        [php_max_input_vars] => 6000
        [max_upload_size] => 67108864
        [default_timezone] => UTC
        [theme] => Array
            (
                [name] => X – Child Theme
                [version] => 1.0.0
                [parent_theme] => X
            )
    
        [active_plugins] => Array
            (
                [0] => cornerstone/cornerstone.php
                [1] => perfect-woocommerce-brands/main.php
                [2] => tco-under-construction/tco-under-construction.php
                [3] => woocommerce-google-analytics-pro/woocommerce-google-analytics-pro.php
                [4] => woocommerce-products-filter/index.php
                [5] => woocommerce-variation-master/woocommerce-variation-master.php
                [6] => woocommerce/woocommerce.php
            )
    
        [pwb_options] => Array
            (
                [version] => 1.7.0
                [wc_pwb_admin_tab_brand_single_position] => after_meta
                [old_wc_pwb_admin_tab_slug] => marke-test
                [wc_pwb_notice_plugin_review] => 0
                [wc_pwb_admin_tab_slug] => marke-test
                [wc_pwb_admin_tab_brand_desc] => yes
                [wc_pwb_admin_tab_brand_single_product_tab] => yes
                [wc_pwb_admin_tab_brands_in_loop] => no
                [wc_pwb_admin_tab_brands_in_single] => brand_image
                [wc_pwb_admin_tab_brand_logo_size] => woocommerce_thumbnail
            )
    
    )
    • This reply was modified 5 years, 7 months ago by Mr. W.
    • This reply was modified 5 years, 7 months ago by Mr. W.
    Mr. W

    (@gabriel-winnberg)

    Ok, I wasn’t aware that anything put into the post permalink structure would be prepended to custom taxonomies, unless 'with_front' => false.

    I found this solution to be put into functions.php, it does set the correct URL but no page is generated (404):

    https://wordpress.stackexchange.com/questions/224371/how-to-change-with-front-key-from-an-existing-custom-post-type

    Perhaps you @masedinet are able to tweak it?

    Thread Starter masedinet

    (@masedinet)

    @gabriel-winnberg nice hint, your link is for custom post type arguments filter hook, i think our solution is by using the taxonomy arguments filter hook. why I didn’t think about it before ^^

    put this code into functions.php

    
    function fix271218_pwb_taxonomy_args( $args, $taxonomy, $object_type ) {
    
        if ( 'pwb-brand' === $taxonomy && is_array( $args ) ) {
            /* alter the rewrite with front arg */
            $args[ 'rewrite' ][ 'with_front' ] = false;
        }
        return $args;
    }
    add_filter( 'register_taxonomy_args', 'fix271218_pwb_taxonomy_args', 10, 3 );
    

    I am not yet tested it, but hopefully work fine

    • This reply was modified 5 years, 7 months ago by masedinet.
    Mr. W

    (@gabriel-winnberg)

    Thanks but I get the same result, it removes the “blog” slug but returns a 404. A bit further down, on the page I linked to, there’s a solution for taxonomies that I modified.

    Somewhere I read somewhere that has_archive must be set to true for it to work, could that be it?

    Plugin Contributor titodevera

    (@titodevera)

    Hi Gabriel.

    The masedinet´s tweak works like a charm, don´t forget to update your permalink structure after added the code snippet, otherwise you will get a 404 error on all brands pages.

    For the next release i will introduce a new filter hook for allow to change this option easily.

    🙂

    Hello Tito

    I have the same problem on my website. I want to separate the products from blog articles and so I make use of a custom permalink structure that includes “/blog/” in the link, but this causes all brand pages to also include “/blog/” which I don’t want. Well, basically as the OP explained.

    I wanted to check, have you implemented a fix for this yet or should I follow the functions.php fix that was proposed?

    PS. Oh, I see it is in the changelog of the last version. But how do I use it?

    Regards
    Johan

    • This reply was modified 5 years, 5 months ago by fautam.

    Tito I seriously need your help please.

    After I installed the plugin, I keep finding links like that: https://savemnt.com/brand/mobiles-tablets/mobiles/huawei/

    I dont have that link any where on my website so it give 404 error.

    I even removed the plugin, however I still get these Brand links on google, please tell me how to remove it.

    I have the same issue. I want my blog posts to have /blog/ in the url but not my brands. I also see these but how do I fix my permalinks?

    Dev: New filter ‘pwb_taxonomy_rewrite’ to change the rewrite slug
    Dev: New filter ‘pwb_taxonomy_with_front’ to change default

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Remove ‘blog’ from the brand permalink structure’ is closed to new replies.