carasmo
1/19/2017 - 7:01 PM

Genesis Only: allow shortcodes and autoembed in Genesis Archive Intro Text output.

Genesis Only: allow shortcodes and autoembed in Genesis Archive Intro Text output.

<?php
//do not add if it's already at the top of your page

//* Allow shortcode on Genesis Archive Intro Text Tags and Categories
add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );

//* Allow shortcode on Genesis Author Intro Text
add_filter( 'genesis_author_intro_text_output', 'do_shortcode' );

//* Allow shortcode on Genesis CPT ie: ('supports' => array( 'genesis-cpt-archives-settings' )
add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode' );
<?php
//do not add if it's already at the top of your page
// don't add the 'shorcode-support-archive-intro-text.php' one, this covers both.

/**  
 *
 * Add shortcode and autoembed support to Archive Intro Text
 * change yourprefix_ in two locations
 *
 */
function yourprefix_embed_shortcode_archive_intro_text() {

	global $wp_embed;

	//* Allow shortcodes and embeds on Genesis Archive Intro Text Tags and Categories
	if ( is_category() || is_tag() || is_tax() ) {
		
		add_filter( 'genesis_term_intro_text_output', array( $wp_embed, 'autoembed' ) );
		add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );

	} //* endif term 
	
	if ( is_post_type_archive() && genesis_has_post_type_archive_support() ) {
		
		add_filter( 'genesis_cpt_archive_intro_text_output', array( $wp_embed, 'autoembed') );
		add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode' );


	} //* endif cpt

	//* Allow shortcodes and embeds on Genesis Author Intro Text
	if ( is_author() ) {
		
		add_filter( 'genesis_author_intro_text_output', array( $wp_embed, 'autoembed') );
		add_filter( 'genesis_author_intro_text_output', 'do_shortcode' );

	} //* endif author
		
}
add_action( 'genesis_before', 'yourprefix_embed_shortcode_archive_intro_text' );