Skip to content

Instantly share code, notes, and snippets.

@henshaw
Created May 4, 2025 02:31
Show Gist options
  • Save henshaw/774fa134aa7a93de2098160d52f8af29 to your computer and use it in GitHub Desktop.
Save henshaw/774fa134aa7a93de2098160d52f8af29 to your computer and use it in GitHub Desktop.
WordPress functions for dynamically inserting data into BreadcrumbList schema markup
// For category ListItem
"@id": "<?php echo $cat_link ?>"
"name": "<?php echo get_the_category( $id )[0]->name; ?>"
// For post ListItem
"@id": "<?php the_permalink(); ?>"
"name": "<?php the_title(); ?>"
@henshaw
Copy link
Author

henshaw commented May 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment