Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 68e5a8ba1f
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (51 sloc) 1.96 KB
* functions.php allows you to create and run custom PHP functions you can use in your theme.
* It's essentially a WordPress plugin that's loaded when this theme is active.
* Like most theme files, it's completely optional.
* Learn more: <>
// Automatically output feed autodiscovery links at wp_head() in the <head>.
* Register a dynamic sidebar.
* This tells WordPress to create a dynamic sidebar for us.
* We'll call this one in sidebar.php.
* More here: <>
'name' => 'Sidebar',
'id' => 'sidebar',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>'
* Say hello to a WordPress hook.
* These guys are a really important part of WordPress, because they allow you to add things to the theme without changing the actual theme code.
* We're going to add a pingback discovery link for pingback servers.
* First, we create a function:
function gbl_render_pingback_link() {
echo '<link rel="pingback" href="' . get_bloginfo('pingback_url') . '" />';
* Here's where the magic happens.
* add_action is a WordPress function that lets you "hook" into different named areas.
* We'll hook into wp_head, which means this function will get run where the wp_head() tag is (in the <head> tag in header.php).
* Learn more: <>
* ...and <>
* Here's another hook
* This one will add a script for threaded comments if we're on a single page
function gbl_enqueue_script_comment_reply() {
if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
add_action('wp', 'gbl_enqueue_script_comment_reply');
Jump to Line
Something went wrong with that request. Please try again.