Primary category not passed on to query for slug
-
Hi,
I’m using Yoast SEO in combination with Ajax Load More plugin.Posts are in multiple categories, but each has its primary category configured, for example “Workshops”. However, when I visit the Workshops page (which is the category Workshops posts overview), all links to posts refer to the wrong category slug (alle-activiteiten), even though none of the posts have alle-activiteiten as their primary category.
I’ve reached out to the ALM plugin makers, but they do not know how the primary category is ‘called’ by Yoast SEO. Here is the topic link:
topic on ALM plugin pageI also tried several options mentioned on a Yoast issue page on github which seems to touch on the subject: link to issue page on github.
However, none of the suggestions work. I think the problem lies within this piece of code in the theme’s category.php file:
$queried_object = get_queried_object(); $taxonomy = $queried_object->taxonomy; $term_id = $queried_object->term_id; $ajax_tag = ''; $tags = array(); $ajax_category = 'category="'.$queried_object->slug.'" ';
The $ajax_category variable is later on referred in the ALM shortcode to call the slug. Can you help me figure out why this slug does not match the primary category? How should I call that within the category.php file?
The page I need help with: [log in to see the link]
- The topic ‘Primary category not passed on to query for slug’ is closed to new replies.