• TesterGP

    (@testergp)


    Dear,

    I am trying to display in the archive page the results in such a way that only the accordion bar is displayed per post and when clicking on the + sign you can see the excerpt.
    I tried several possibilities :

    1. add echo the do_shortcode('[su_accordion]'); above the content.php page and the closing echo do_shortcode('[/su_accordion]'); at the bottom of content.php. Then added echo do_shortcode('[su_spoiler title="Spoiler title" style="fancy"]'); just under <header class="entry-header page-header"> and echo do_shortcode('[/su_spoiler]'); before the <?php endif; ?> at the bottom of content.php.
    2. add the opening su_accordion shortcode in archive.php just before the loop starts. And added the closing su_accordion after the closing of the loop (endwhile). Added the su_spoiler and the /su_spoiler the same way as in point 1 in content.php

    I read on WP that for opening an closing shortcodes you need following code echo do_shortcode( '[iscorrect]' . $text_to_be_wrapped_in_shortcode . '[/iscorrect]' );

    Any idea how to handle this?

    https://www.ads-software.com/plugins/shortcodes-ultimate/

  • The topic ‘accordion shortcode within archive.php and spoiler within content’ is closed to new replies.