Support » Plugin: PHP Code Widget » HTML Include File

  • Resolved FredG

    (@fredg)


    I’m trying to display an HTML file if the user is not logged in. My code is:

    <?php
    if (is_user_logged_in()){
        echo "Welcome, registered user!";
    } else {
        echo "Welcome, visitor!";
        include("http://www.guytonsoftware.com/optionsmoneymaker/wp-content/themes/OMM Child/test.html");
    };
    ?>

    I get the echo welcome messages, but the html file does not dsiplay. I can display the file in a browser using that URL.

    thanks

    http://wordpress.org/extend/plugins/php-code-widget/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    The include command is for including local files, not for including URLs. Most servers don’t allow URL fopen’s, so you can’t include a URL that way.

    Try include(ABSPATH.'/wp-content/themes/OMM Child/test.html'); instead.

    Worked perfectly!

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML Include File’ is closed to new replies.