Skip to content

Instantly share code, notes, and snippets.

// create shortcode to list videos visually on video resource page with schema
add_shortcode( 'videos', 'videos_shortcode' );
function videos_shortcode( $atts ) {
ob_start();
extract( shortcode_atts( array (
'category' => '',
'quantity' => -1,
'p_id' => ''
), $atts ) );
@bruceprock
bruceprock / functions.php
Last active July 2, 2025 13:57
snippet in functions.php that needs content entry filter based on post-type/terms to apply product or review or creative schema entry-content all within the page
//Add Custom Micro Data To Specific Pages In Genesis using Yoast Genesis Schema Helper Script
add_filter( 'genesis_attr_body', 'custom_microdata_schema' );
function custom_microdata_schema( $attr ){
if( is_front_page() ){
add_filter( 'genesis_attr_entry', 'yoast_schema_product', 20 );
add_filter( 'genesis_attr_entry-title', 'yoast_itemprop_name', 20 );
add_filter( 'genesis_attr_entry-content', 'yoast_itemprop_description', 20 );
add_filter( 'genesis_post_title_output', 'yoast_title_link_schema', 20 );
}