Custom page, custom query
-
If I use your shortcode on a page from the admin section, your plugin works just fine demonstrating the theme is set up okay. Your javascript file is just before the end Body tag.
However, if I add your shortcode to a custom page that has a custom query, it parses the titles okay, but doesn’t add structural html to anything.
My code on the custom page is basically like this:
<?php do_shortcode (‘[accordion]’); ?>
— start the loop code here —
<?php do_shortcode (‘[accordion-item title=”‘. the_title() . ‘”]’); ?>
my contents here
<?php do_shortcode (‘[/accordion-item]’); ?>
— end of the loop code here —
<?php do_shortcode (‘[/accordion]’); ?>Source code of the custom page has this near the end body tag:
<script type=’text/javascript’>
/* <![CDATA[ */
var accordionShortcodesSettings = [{“id”:”accordion-1″,”autoClose”:true,”openFirst”:false,”openAll”:false,”clickToClose”:false,”scroll”:false}];
/* ]]> */
</script>
<script type=’text/javascript’ src=’https://MYDOMAIN-HERE/wp-content/plugins/accordion-shortcodes/accordion.min.js?ver=2.2.4′></script>Any ideas why the html isn’t being added?
Thanks.
Chuck
- The topic ‘Custom page, custom query’ is closed to new replies.