Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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
    Jasmin

    #1078124

    Hey jazzminus,

    Can you please share a mockup of what you’re trying to achieve with this code?

    Best regards,
    Victoria

    #1078182

    Hey 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,
    Jasmin

    #1079048

    Hi 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 5 years, 3 months ago by jazzminus.
    #1080172

    Hi,

    Yes, that’s a valid code. Is it rendering the content of the source properly?

    Best regards,
    Ismael

    #1080283

    Hi,

    yes, thank you. So we can close the thread.

    Best regards
    Jasmin

    #1080925

    Hi,

    Cool. We’ll close the thread now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Include a URL with PHP shortcode in a post’ is closed to new replies.