osompress / genesis-portfolio-pro

Plugin: Genesis Portfolio Pro
24 stars 14 forks source link

Use embed code in Portfolio Archive section #21

Closed theVasilis closed 6 years ago

theVasilis commented 6 years ago

I’m trying to embed a YouTube video in the Portfolio Type archive section.

Tried with iframe code, WordPress embed code and just using a plain link but nothing works.

The Portfolio Archive just shows the code…

Is there a way we can make the Portfolio Archive read the embed code and bring up the video?

nickcernis commented 6 years ago

This relates to how Genesis outputs archive intro text. (It runs text through wpautop but no other functions.)

You could use this code in your theme's functions.php to process shortcodes and oembeds too:

add_action( 'genesis_meta', 'custom_filter_archive_intro_text' );
function custom_filter_archive_intro_text() {
    global $wp_embed;
    add_filter( 'genesis_term_intro_text_output', array( $wp_embed, 'autoembed' ) );
    add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );
}
theVasilis commented 5 years ago

@nickcernis thank you for the update and sorry for late reply.

Is this code included in the latest update of the plugin or should I add it manually to every website I manage?

Keep in mind that not every one of us is a developer who knows how to use these codes.

Thank you again.

nickcernis commented 5 years ago

@theVasilis The code has not been included as part of the plugin, as it relates to a Genesis feature rather than a plugin feature.

I have opened an issue in the main Genesis repository to see if there is interest in adding it to Genesis.

The code above is still safe to add to sites for now. If Genesis includes it in the future it will not break your site.