accordion shortcode within archive.php and spoiler within content
-
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 :- add
echo the do_shortcode('[su_accordion]');
above the content.php page and the closingecho do_shortcode('[/su_accordion]');
at the bottom of content.php. Then addedecho do_shortcode('[su_spoiler title="Spoiler title" style="fancy"]');
just under<header class="entry-header page-header">
andecho do_shortcode('[/su_spoiler]');
before the<?php endif; ?>
at the bottom of content.php. - 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?
- add
- The topic ‘accordion shortcode within archive.php and spoiler within content’ is closed to new replies.