• Resolved netschmiede24

    (@netschmiede24)


    Hi,

    I recently developped a website for a technical company with pods which reflect the entire product catalogue on a subdomain, let’s say wp.domain.com . Once I finished the website, I changed the URL to http://www.domain.com. All seemed to work fine, but now I noticed something that I don’t know how to fix.

    The products are in several categories – and I have a menu with entries for every category.

    I also use breadcrumbs by Yoast SEO to navigate easily between the productcategories.

    So for example we have a page
    http://www.domain.com/products/category1/subcategory1

    On this site it lists all of the products in the subcategory1 – but the link of the actual products are just
    http://www.domain.com/product/productname

    Hence the usual breadcrumbs didn’t work, and I switched them off for the products.

    Therefore I added a relationship field called “zugehorige_seite” to the product pod template and for each product I added the page where it is listed.

    Then in the product template, I manually added a breadcrumb, which would then reflect the breadcrumbs:

    <span><a href="../../">Home</a></span> » 
    	<span><a href="{@zugehorige_seite.guid}">{@produktkategorie}</a></span> » 
    	<span style="breadcrumb_last" aria-current="page"><strong>{@post_title}</strong></span>

    This worked perfectly, as long as I was still working on the SUBDOMAIN.

    Now that the entire website has switched to http://www.domain.com – I noticed that the breadcrumbs for the products still go to wp.domain.com

    So instead of linking {@zugehorige_seite.guid} to the page http://www.domain.com/category1/subcategory1 it will link it to wp.domain.com/?page_id=xyz

    I used Better Search and Replace to change every wp.domain.com in the database to http://www.domain.com – however, this does not change my breadcrumbs.

    Any idea, where I can fix this?

    Thanks,

    Astrid

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support pdclark

    (@pdclark)

    GUIDs are not permalinks, and are not meant to be used for that purpose, as they are not updated when the permalink structure changes or the domain changes, and apparently Better Search and Replace does not modify them.

    Use {@zugehorige_seite.permalink} to get the appropriate URL according to the current site domain and permalink structure.

    Optionally use wp search-replace wp.domain.com www.domain.com --all-tables to update the domain everywhere in the database, if it’s desired to see those fields updated even though they are not meant to be used as links.

    Plugin Support pdclark

    (@pdclark)

    Also see this StackExchange thread for examples of how to modify the Yoast SEO Breadcrumb structure for a given post type, if it’s desirable to not be running two breadcrumb templates.

    Thread Starter netschmiede24

    (@netschmiede24)

    Thank you! The {@zugehorige_seite.permalink} is not listed in the pod reference, so I didn’t find this – works perfectly, thanks.

    Astrid

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

The topic ‘Wrong URL for relationship field’ is closed to new replies.