How to execute/parse X shortcodes in a custom php page?

I am building a site that executes PHP code to fetch data from an API called Galileo (used for Hotel booking)

The PHP output contains hotel information which I need to format nicely, so far have been using only HTML, JQuery and CSS to trick up the look and feel. I can do so much more if I can learn how to execute X shortcodes inside of my PHP file, like accordion, icons etc. Otherwise I have used bootstrap to format the content output.

Hello @peeyush.works,

Thanks for writing in!

We only have the available classic element shortcodes which can be found here: http://demo.theme.co/integrity-1/shortcodes/

If you want to execute/parse shortcode, you can make use of the do_shortcode() function. For more details, please check this out: https://developer.wordpress.org/reference/functions/do_shortcode/

Hope this helps. Kindly let us know.

Thanks Rue, but this is what I was writing about, I am actually using the classic shortcodes and exactly the same way as mentioned in that wordpress.org link. But I am getting zero output. Same shortcodes work just fine within a regular wordpress post or page. The PHP file I use to connect to Galileo throws its output in a DIV marked to receive it using AJAX.
Please help.

Hi @peeyush.works,

May I know how you execute it? Maybe the contents aren’t captured or echoed after the execution so it’s probably related to the code you implemented or Galileo.

I may not able to provide a solution but maybe I could provide some information on what I can find.

Thanks!

Hi @Rad, I assume you misunderstood, I am getting perfect outputs from my code, it is when I use a X shortcode I get nothing. So currently my hotel information is being displayed in a bootstrap grid without any X elements like accordion etc. What I would love to do is to use the shortcodes X offers and use them to beautify the output, am sending you the URL in a private reply. Click on destination, pick any date a couple of months down the line, and hit search icon. It will show you buttons, clicking which would show the hotels, it is being worked on as we speak so expect the display to change.

Hello @peeyush.works,

The given credentials has a very limited privileges. We cannot check your codes how you have done the custom template. Please at least make it as an administrator so that we maybe able to see your custom page, templates and codes.

Thank you in advance.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.