Support » Plugins and Hacks » PHP Code Widget » [Resolved] HTML Include File

[Resolved] HTML Include File

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

    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.



Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!


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