• I just have a few questions…and many more in the future! So expect to be seeing a lot of me!

    <?php
    /**
     * Loads the WordPress environment and template.
     *
     * @package WordPress
     */
    
    if ( !isset($wp_did_header) ) {
    
    	$wp_did_header = true;
    
    	require_once( dirname(__FILE__) . '/wp-load.php' );
    
    	wp();
    
    	require_once( ABSPATH . WPINC . '/template-loader.php' );
    
    }
    
    ?>

    1. isset is to check to see if a variable is set. The $wp_did_header is set to true but what is the actual variable?

    2. The first require_once calls for the “wp-load.php”, but I’m confused about “dirname(_FILE_)” (mainly the FILE part). I can understand the dirname as directory name but I don’t understand _FILE_; Isn’t it supposed to be a variable or a string? Why can it get away without using a “$”?

    3. wp(); is just sitting there and it doesn’t look like it does anything. What does it actually do and how does it work? Is it calling a function without using include or require?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not to sound sarcastic but… isn’t it $wp_did_header? To my understanding of programming, that IS the variable.

    Thread Starter EGuy

    (@eguy)

    Ok, I believe you’re right. But, my understanding is when you set variables, you set them to have strings or values. Why is it just set as true?

    A variable can be set to true or false to act as a switch. It’s the core language of 1s and 0s that make up basic programming… in this case, true or false. Since it is being introduced in a condition, there must be some other code that sets it to true. I really can’t tell you where that code is or how to trigger it.

    I’m also thinking dirname FILE is a folder or file in your directory named FILE… maybe? and again not to sound sarcastic. I have a simple understanding of programming but that sounds right to me.

    That’s all I can tell you. I’m learning all this myself and you probably know more than me. I try… I try.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp-blog-header.php questions…’ is closed to new replies.