WordPress.org

Ready to get started?Download WordPress

Forums

trying to include header on non wp page (7 posts)

  1. silent1643
    Member
    Posted 6 years ago #

    err trying to call my wordpress header onto a separate web page that does not run on wp but cannot seem to get it to work.

    using
    <?php include("http://mydomain.com/blog/wp-content/themes/my_theme/header.php"); ?>

    but the result

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.guy/mydomain/jobs/index.php on line 1
    
    Warning: include(http://mydomain/blog/wp-content/themes/my_theme/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.guy/mydomain/jobs/index.php on line 1
    
    Warning: include() [function.include]: Failed opening 'http://mydomain/blog/wp-content/themes/my_theme/header.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.guy/mydomain/jobs/index.php on line 1
  2. whooami
    Member
    Posted 6 years ago #

    fopen is disabled (for at the very least urls)

    thats a server issue, not a wordpress issue.

    see if you can do the include using the path to the file and not the absolute url.

    if you cant then you probably need to to use curl. In that case google for how to use curl.

    here, I did the googling for you.

    http://wiki.dreamhost.com/index.php/CURL

  3. marhoons
    Member
    Posted 6 years ago #

    my dear,
    i think its not best way to call your header like that if you want use include use directly the directory and sub....
    like:
    include("blog/wp-content/themes/my_theme/header.php");

    should be work as well..
    but i dont now.. i tried befor include header & foter but between them always the test shows in the down of page!!

    i think i ask about same idea in the related link:
    http://wordpress.org/support/topic/179008?replies=1

    Regards,
    Marhoons

  4. whooami
    Member
    Posted 6 years ago #

    oh and look at that, youre even hosted on dreamhost -- there you go.

  5. silent1643
    Member
    Posted 6 years ago #

    yeah fopen is off - i can setup my on php.ini file to fix this.
    I will also try using the correct path code.. and post back.

    just trying to make my job board similar to my blog :)

    dreamhost rocks !

  6. silent1643
    Member
    Posted 6 years ago #

    ok turned on fopen and url_include and the only error left is

    Fatal error: Call to undefined function wp_head() in /home/.guy/mydomain/blog/wp-content/themes/my_theme/header.php on line 24

    anyway to fix this?

    the php page i am calling the header is in /mydomain/jobs

    my wp is located in /mydomain/blog

  7. silent1643
    Member
    Posted 6 years ago #

    okay after fumbling around with all the code i figured out i can acomplish adding my blog header to my job board by turning the header.php into html
    while using the php include function

    but i rather not do this, what do i need to require so that the wordpress functions/code will work outside the wp folder?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.