
-
AuthorPosts
-
March 8, 2019 at 11:11 am #1076290
Hello,
thanks for your awsome work. I have been an Enfold customer several times and always very satisfied.
Now I have a question regarding PHP Code in Posts: I want to include a URL with a PHP Shortcode. I tried “Insert PHP Plugin” and “PHP everywhere”, but both do not work on my enfold site. It doesn’t display anything. I am using PHP 7.1 and WP 5.1 and the current versioin of Enfold. I tried several editors and
On other websites with different themes the same PHP code works with both plugins.
In other threads I read something about using a new template for posts, however, it’s been a long time that I created a new template (and that was with a different theme). Is there any documentation for Enfold which I could use? I another thread I read that you mention the Shortcode API, but this is beyond my abilities.
This topic affects this one website where I want to include a URL (it is a web app) and additionally I am thinking about switching another website to Enfold which also uses PHP Shortcodes. Therefore, I really hope, there is a chance to implement it.
Thanks again for your work and best regards
JasminMarch 13, 2019 at 8:18 am #1078124Hey jazzminus,
Can you please share a mockup of what you’re trying to achieve with this code?
Best regards,
VictoriaMarch 13, 2019 at 9:23 am #1078182Hey Victoria,
thanks for following up! I am not sure what is meant by mockup. But what I am trying to do is include what is displayed by the web app I posted in the private data section of my previous post.
Best regards,
JasminMarch 15, 2019 at 9:54 am #1079048Hi Victoria,
i asked the plugin authors for advice and this is what they told me to use:
[insert_php] if(ini_get('allow_url_fopen')){ echo file_get_contents('https:/.../'); }else{ echo 'Cannot connect: allow_url_fopen is false'; } [/insert_php]
Now it works. Is it a good solution from your point of view?
Best regards
Jasmin-
This reply was modified 6 years ago by
jazzminus.
March 19, 2019 at 2:34 am #1080172Hi,
Yes, that’s a valid code. Is it rendering the content of the source properly?
Best regards,
IsmaelMarch 19, 2019 at 10:15 am #1080283Hi,
yes, thank you. So we can close the thread.
Best regards
JasminMarch 20, 2019 at 5:12 pm #1080925 -
This reply was modified 6 years ago by
-
AuthorPosts
- The topic ‘Include a URL with PHP shortcode in a post’ is closed to new replies.