Shortcode Content showing in Backend but not on Frontend

Hi there,

we are trying to include a php file with an shortcode.
Therefore we added the following code to our Pro V4-Child Theme functions.php:

function support_function() {
     include_once 'support.php';
}

add_shortcode('support', 'support_function');

The output of support.php is showing in PRO Backend Editor without any Problem as shown in the screenshot below:

But when i save the site the frontend doesn’t show anything. I dont even get a PHP Error or any Error in Google Chrome Console. The Column with the Text-Element / Raw-Element (tried both) is just empty as shown in the following screenshot:

Can you help me with this problem? This is only a staging environment – actually we have the exact same website running on another server with PRO V3 and it’s working there. I will add the links in a secret note to this topic.

Best regards from Germany
Max

Hi @partnerundsoehne,

Thanks for reaching out!

Would you mind sharing your admin credential so that we can take a look? Please keep in mind that we don’t support any customization but we would like to know why it is not showing on the front-end. To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hi @marc_a, i added the data to the secure note :slight_smile:
Looking forward to hearing from you soon.

Hi Max,

You need to specify the full path to include the file into your shortcode like the following examples.

include_once (get_theme_file_path().'/support.php'); 

Your code look like this:

function support_function() 
{
        include_once (get_theme_file_path().'/support.php'); 
}
add_shortcode('support', 'support_function');

I would suggest you go through the following article on the get_theme_file_path function to know more.

Hope it helps.
Thanks

Hi @tristup, thank you very much for your help! Unfortunately this code didn’t solve the problem. I can still see the php output (support form) in backend but not in frontend. Do you have any other idea how we can fix this? :confused:

Hi Max,

Although it is not an issue related to the theme and we don’t offer any support or investigation to custom codes or related issues. But we are still curious to know the reason behind that and tried to log in with the given credentials, but unfortunately, it didn’t work. I would suggest you check and reshare the credentials.

Thanks

Hi @tristup, i renewed the login credentials and edited them in my secure note in the original post. Would it help if we book your “One” Subscription to solve this problem?

Hi @partnerundsoehne,

Yes, If you subscribe to One plan, we can help you dig down on this problem.

Thank you.

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