Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1262135

    Hello,

    I would like to change the link in the generated breadcrumb visiting a post. Now it links to /category/blog. I would like to change that to the page where I show my own version of the category-page. So I would like to link to my own page in the breadcrumbs. Can you help me with that?

    Regards,

    Erwin

    #1262262

    Hi Erwin,

    Can you try to change the permalink in Settings > Permalinks > Optional > Category base?
    Let us know if this helps.

    Best regards,
    Nikko

    #1262325

    Hi,

    That was my thought to. But I have multiple categories, al with their specific page where the cat is displayed. How can I set a base for that?

    regards,
    Erwin

    #1262389

    Hi Erwin,

    I see, can you give us links so we can try to have the same setup and try to give some code that might help?
    Using this format: link – how breadcrumb should be structured
    Example:
    mywebsite.com/blog/article1 – home > blog > seo
    mywebsite.com/blog/article2 – home > blog > design
    You can post it in private content.

    Best regards,
    Nikko

    #1262436

    Hi,

    I’ve put the links in the private-content area below.

    Regards Erwin

    #1262653

    Hi Erwin,

    I can’t see any breadcrumbs on its articles.
    Do you want it to look something like the breadcrumbs posted in private content?

    Best regards,
    Nikko

    #1262717

    Hi,

    In that case the site would use the default categories. I’ve created a page for those categories to show the posts on that specific way. So, instead of the category page, I would like to use the specific pages. See the image for the breadcrumbs

    Regards
    Erwin

    #1263529

    Hi Erwin,

    I apologize for the delayed response.
    Thanks for the screenshot, that’s actually a post (category) meta.
    You can use this hook to redirect it to the page you want instead of the category page and put it in your child theme’s functions.php:

    function category_template_redirect() {
        if ( is_category( 'blog' ) ) {
            $url = site_url( '/blog' );
            wp_safe_redirect( $url, 301 );
            exit;
        } elseif ( is_category( 'cases' ) ) {
    	$url = site_url( '/cases' );
            wp_safe_redirect( $url, 301 );
            exit;
        }
    }
    
    add_action( 'template_redirect', 'category_template_redirect' );

    The other workaround is use a redirect plugin.

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.