Divi does a lot of crazy stuff, but I’ll see if I can make this attach a bit more cleanly in a new version. Hopefully that’ll help.
You might be able to fix this by conditionally filtering things using the hooks I’ve provided. This is untested:
add_action( 'the_content', 'yournamespace_exclude_infographic' );
function yournamespace_exclude_infographic() {
// See if category archive is being diplayed
if ( is_category() ) {
add_filter( 'infographic_embedder_image_code', 'yournamespace_return_empty_string' );
add_filter( 'infographic_embedder_download_html', 'yournamespace_return_empty_string' );
add_filter( 'infographic_embedder_embed_html', 'yournamespace_return_empty_string' );
}
}
function yournamespace_return_empty_string() {
return '';
}
Hi, this hid all the pages so just header and footer remained.
Any other ideas?
Derp. Gave you the wrong action to hook into. Let’s try this instead.
add_action( 'the_post', 'yournamespace_exclude_infographic' );
function yournamespace_exclude_infographic() {
// See if category archive is being diplayed
if ( is_category() ) {
add_filter( 'infographic_embedder_image_code', 'yournamespace_return_empty_string' );
add_filter( 'infographic_embedder_download_html', 'yournamespace_return_empty_string' );
add_filter( 'infographic_embedder_embed_html', 'yournamespace_return_empty_string' );
}
}
function yournamespace_return_empty_string() {
return '';
}
99% there.
Now there is just “%px” inserted to the end of the excerpt. I found out you can also fix it by simply setting your own custom excerpt in post editing.
Well dang, that’s the one unfilterable part of the content output. Maybe this’ll fix you up enough:
add_filter( 'get_the_excerpt', 'yournamespace_exclude_infographic_percentage' );
add_filter( 'the_content', 'yournamespace_exclude_infographic_percentage' );
function yournamespace_exclude_infographic_percentage($output) {
// See if category archive is being diplayed
if ( is_category() ) {
$output = str_replace( '%px', '', $output );
}
return $output;
}
Yeah, custom excerpts will definitely fix it in any case, but I’d prefer for you to not have to do that. 🙂
Thanks. Unfortunately take that cool functionality to Download infographic also from the grid view where it works. But I understand it might be hard, there must be some reason why Divi blog grid works but Divi blog fullwidth doesn’t.
Anyway take it as problem solved. Thanks