Title: Custom page, custom query
Last modified: August 30, 2016

---

# Custom page, custom query

 *  Resolved [cmrivera](https://wordpress.org/support/users/cmrivera/)
 * (@cmrivera)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/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
   =’[http://MYDOMAIN-HERE/wp-content/plugins/accordion-shortcodes/accordion.min.js?ver=2.2.4′></script&gt](http://MYDOMAIN-HERE/wp-content/plugins/accordion-shortcodes/accordion.min.js?ver=2.2.4′></script&gt);
 * Any ideas why the html isn’t being added?
 * Thanks.
    Chuck
 * [https://wordpress.org/plugins/accordion-shortcodes/](https://wordpress.org/plugins/accordion-shortcodes/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [cmrivera](https://wordpress.org/support/users/cmrivera/)
 * (@cmrivera)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/custom-page-custom-query/#post-6541720)
 * I ran a test with your basic example outside of the loop and it was not get processed.
   Here’s what I ran:
    $mycontent = ‘[accordion] [accordion-item title=”Title of
   accordion item”]Drop-down content goes here.[/accordion-item] [accordion-item
   title=”Second accordion item”]Drop-down content goes here.[/accordion-item] [/
   accordion]’; do_shortcode ($mycontent);
 * Result was blank.
 *  Plugin Author [philbuchanan](https://wordpress.org/support/users/philbuchanan/)
 * (@philbuchanan)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/custom-page-custom-query/#post-6541730)
 * Try using
 * `echo do_shortcode($mycontent);`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom page, custom query’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/accordion-shortcodes.svg)
 * [Accordion Shortcodes](https://wordpress.org/plugins/accordion-shortcodes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accordion-shortcodes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accordion-shortcodes/)
 * [Active Topics](https://wordpress.org/support/plugin/accordion-shortcodes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accordion-shortcodes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accordion-shortcodes/reviews/)

## Tags

 * [custom-query](https://wordpress.org/support/topic-tag/custom-query/)

 * 2 replies
 * 2 participants
 * Last reply from: [philbuchanan](https://wordpress.org/support/users/philbuchanan/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/custom-page-custom-query/#post-6541730)
 * Status: resolved