Starter Guide On Header.php

Ravael Angeline has a tutorial posted on WP.Tutsplus.com that covers the basics of a header.php file. This particular file is located in every WordPress theme and is essential to how a theme works. Also worthy of reading following the tutorial is a comment by Tom McFarlin.

1

One response to “Starter Guide On Header.php”

  1. This is more like “Ancient History” Starter Guide on header.php ;)
    http://wp.tutsplus.com/tutorials/theme-development/the-header-php-what-needs-to-go-in-it-and-what-doesnt/#comment-19170

    wp_register_script and wp_register_styles are not recommended nor best practice guide, it should be wp_enqueue_script only e.g.

    function my_custom_script() {
    wp_enqueue_script( ‘custom-scripts’, get_template_directory_uri() . ‘/js/custom-scripts.js’, ‘jquery’, ’1.0′, false );
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_custom_script’ );

    and this doesn’t need to be registered at all.

    Another example: https://github.com/thethemefoundry/twentytwelve/blob/master/build/functions.php

    Cheers,
    Emil

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Discover more from WP Tavern

Subscribe now to keep reading and get access to the full archive.

Continue reading