endwhile; <?php // as it should be foreach ($lastest_posts as $post) { echo $post->title; echo $post->excerpt; } http://codex.wordpress.org/Global_Variables
echo ‘hello world !’; } add_action( ‘wp_footer’ , ‘plugin_footer ); do_action( ‘wp_footer’ ); <?php // how plugins should works class Footer extends SPLSubject { /*...*/ } class FooterPlugin extends SPLObserver { function update() { echo ‘hello world !’; } } $wp_footer = new Footer(); $wp_footer->attach( new FooterPlugin() ); $wp_footer->notify(); http://codex.wordpress.org/Plugin_API
$query_args = '' ) { $this->init(); $this->parse_request($query_args); $this->send_headers(); $this->query_posts(); $this->handle_404(); $this->register_globals(); do_action_ref_array( 'wp', array( &$this ) ); } } // ... require '/template-loader.php' ; 1. initiate build WP_User instance into $current_user global 2. parse request retrieves params into self::$query_vars 3. send http headers send headers and terminate if needed 4. retrieves infos from database parse and execute $wp_query and then retrieves posts 5. handle 404 changes the http headers already sent if a not found error occurred during the request 6. register lot of globals retrieves posts data and set them into globals vars 7. send signal to plugins say to the plugins that they can do things here 8. render php script as template execute a php script as a template and directly output the result
global $wp_the_query; $this->build_query_string(); $wp_the_query->query( $this->query_vars ); } } not even passed as parameter !! WTF ?! http://develop.svn.wordpress.org/branches/3.9/src/wp-includes/class-wp.php