Site logo

Archived topic

Two post lists - what to use; WP Show Posts or GP dynamic content features...?

17 replies · Started by Peter on July 16, 2021

Viewing posts 16–18 of 18

Thanks for sending the video Simon.
Yeah reading up on this its looks like a mixture of WP sanitizing the HTML and the Gutenberg editor doing some funky things.
We could throw some code at it.

But would creating a separate WPSP list for each of your categories be a viable solution for you?
This will remove the need for the shortcode args and all should work fine.

I'm currently using Elvin workaround that work great, and if necessary i can extend it. Thank you

add_shortcode('wrapped_wpsp', function($atts){
$atts = shortcode_atts( array(
'id' => '',
'taxonomy' => '',
'term' => ''
), $atts, 'wrapped_wpsp' );

$settings = array(
'taxonomy' => $atts['taxonomy'],
'tax_term' => $atts['term'],
);

ob_start();
wpsp_display( $atts['id'], $settings );
return ob_get_clean();
});
With this, you can do shorcode [wrapped_wpsp id="1234" taxonomy="category" term="category_1"]

Awesome - glad to hear you got it working!

This archived topic is closed to new replies.