Jump to content

Output wp shortcode in php page


StefanoLisi

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

 

Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.