WordPress.org

Ready to get started?Download WordPress

Forums

Creating plugin: Cant find wp-blog-header ... (5 posts)

  1. XeroCool
    Member
    Posted 9 years ago #

    Warning: main(./wp-blog-header.php): failed to open stream: No such file or directory in /usr/home/xerocool/domains/r0x0rz.info/public_html/blog/wp-content/plugins/myplugin.php on line 30

    require('./wp-blog-header.php');

    What am I doing wrong? I did include, require, etc to retrieve the titles of posts, and links. so whats wrong?

  2. MichaelH
    Member
    Posted 9 years ago #

    You probably have a better feel than me but here's related post:
    http://wordpress.org/support/topic/21784

  3. XeroCool
    Member
    Posted 9 years ago #

    No. Thats nothing that has to do with it. This is for a plugin....

  4. carthik
    Member
    Posted 9 years ago #

    The path to the "require"d files are to be calculated respective to the directory from which the "require" is made, which will be wp-content/plugins.

    So, use absolute paths, or use some way to ensure that the path is right. There are some variables that are set to enable this to happen in an easier fashion. Compare with how others do it for best results

  5. Kafkaesqui

    Posted 9 years ago #

    Unless you're doing something unusual in your plugin, you shouldn't need wp-blog-header.php; plugins run in WordPress' space, so they should already have access to what functionality is found in that script. But if you truly must include the file in your plugin, make sure to pass WP's ABSPATH constant as part of your path:

    require(ABSPATH . 'wp-blog-header.php');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.