Jump to content
Sign in to follow this  

Output wp shortcode in php page

Recommended Posts

Hi i'm using "Multi Rating Plugin" on my wordpress website and it work well in all page. I've an external php script to show operator stats and it work (you can display it in my  homepage). Now I would like to insert into this php code (soap.php) the worpress shortcode that will display rating star system (it work if i add it for example on any page of my website with shortcode [mr_rating_result post_id="63"]). But the problem is that if i insert this short code on my php script i not display rating star

This code not work on my script php (soap.php) http://www.lecartedellamore.it/soap/soap.php

echo do_shortcode("[mr_rating_result post_id='63']");

I not display it on my homepage https://www.lecartedellamore.it/ but i don't see error... If i put this shortcode on wordpress page it work... but if i put in sample external script not work


Share this post

Link to post
Share on other sites

I may not be understanding your question, but do_shortcode() is not a PHP function, it's a WordPress function. If you're trying to call it from a script that isn't run through WordPress (if it's an external script [I think is what you're describing]), it's not going to work.

  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.