Wrong URL for relationship field
-
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/subcategory1On 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/productnameHence 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
The topic ‘Wrong URL for relationship field’ is closed to new replies.