andysweet
Forum Replies Created
-
Hi @aurangajeb,
I tried implementing it manually initially (adding the code to the theme’s functions file then calling the filter in the template) as I didn’t really want to install another plugin and was also concerned about the effect on the pages that are not Advanced Content Types.
However I have now implemented it as you described using WPCode and it is working. Thanks for all your help!
Cheers
AndyHi @aurangajeb,
Thanks for the code suggestion. I tried adding it however the #breadcrumblist element is still being added to the url in the headers and still causing the Google Search Console Error. E.g.:
https://search.google.com/test/rich-results/result?id=pPBUIwyZpiHBYAoxNd82Og
Cheers
AndyHi @aurangajeb,
Thanks for testing that. I would be interested if you find anything as I can’t see anything in my code that is stopping it from working.
I think you might be using some kind of different custom post to me though as your WordPress interface looks different to mine (I don’t have Author, Categories or Comments sections). I’m using Advanced Content Types not Custom Post Types.
Here’s a screenshot showing that the “Enable Breadcrumbs” option is still in my Settings for AIOSEO:Cheers
AndyHi @aurangajeb,
Thanks very much for your reply. When I said that the breadcrumbs option was turned off I meant in AIOSEO’s General Settings in WordPress I have “Enable Breadcrumbs” switched off. I think I may have misunderstood what this means though – is it that it means it isn’t generating the breadcrumbs structure on the page but it is still adding the BreadcrumbList schema?
I should also have said that I was testing adding the BreadcrumbList schema manually to the castle pages myself, so that it what you are seeing on the Rossend Castle page. These castle pages are created dynamically with the Pods plugin using Advanced Content Types.
The bands page is a regular WordPress page, so I now realise that this is probably an issue with how AIOSEO deals with Advanced Content Type pages vs. regular WordPress pages. Despite the code for the breadcrumbs being the same on both types of pages AIOSEO doesn’t seem to be applying the BreadcrumbList schema correctly on the Advanced Content Type pages.
The breadcrumbs structure is different on the Advanced Content Type and regular WordPress pages. On the regular WordPress pages I use some code to automatically generate the breadcrumbs based on the url, but on the Advanced Content Type pages the breadcrumbs are hard-coded manually (because each Advanced Content Type page has its own template and because I seem to remember years ago having an issue with working with the url on Advanced Content Type pages).
The current breadcrumbs code on my castles pages (including the original breadcrumbs structure and also my new structure with the schema added manually):
https://pastebin.com/WtceT92g
The current breadcrumbs code on the bands page:
https://pastebin.com/EKQdyZQe
Cheers
AndyThanks for your reply.
Sorry, I should’ve been clearer, I’m still getting the messages today.
I’m having a similar problem.
The “Related Posts” shown for a post in the backend of WordPress are more or less a perfect match, but looking at the post itself (ie at the front end) I have different, less well-matched, posts and it’s the same 6 related posts appearing on all blog posts.
For example:
http://www.stravaiging.com/art-design/calton-hill-and-the-scottish-national-portrait-gallery/
http://www.stravaiging.com/edinburgh/the-royal-botanic-garden-edinburgh/
http://www.stravaiging.com/edinburgh/a-rooftop-view-of-edinburgh/
I’m not using a caching plugin, and am using a custom template:
<?php if ($related_query->have_posts()):?> <div class="row brown"> <div class="block-heading2 font30 font-white">Related pages</div> <div class="column grid_12"> <?php while ($related_query->have_posts()) : $related_query->the_post(); ?> <?php $img = ''; if ( has_post_thumbnail() ) { $img = get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'title' => $title, 'alt' => $title ) ); } else { $attachments = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => 1 ) ); if ( count( $attachments ) > 0 ) { $img = array_shift( $attachments ); $img = wp_get_attachment_image( $img->ID, 'related-thumbnail', true ); } } $extra_class = ''; if ( $img == '' ) { $img = '<img src="http://www.domain.com/noimage-150x150.jpg">'; } ?> <div class="column grid_2"> <div class="block150 orange shadow-half"> <div class="block-link"> <a href="<?php the_permalink() ?>" rel="bookmark"> <div class="block-link-container"> <div class="block-inner150"> <?php echo $img; ?> </div> <div class="block-inner150"> <div class="block-heading-centre font20 font-white link-white"> <?php the_title(); ?> </div> </div> </div> </a> </div> </div> </div> <?php endwhile; ?> <div style="clear: both"></div> </div> </div> <?php endif; ?>Any ideas why this is happening?