Skip to content

Instantly share code, notes, and snippets.

@rhyswynne
Last active August 29, 2015 14:03
Show Gist options
  • Save rhyswynne/4f12c447ba1f9d9303cf to your computer and use it in GitHub Desktop.
Save rhyswynne/4f12c447ba1f9d9303cf to your computer and use it in GitHub Desktop.
Example functions.php file. This removes the <title> tag and replaces it with the word "Hello!" - Don't run it on a live site!
<?php
// This file is loaded as well as the parent's (twentythirteen) child theme, so name your functions with a prefix. Like below:-
function twentythirteen_child_title( $title, $sep ) {
return "Hello!";
}
// This function is hooked in after the theme is set up. It removes the default title and replaces it with the word "Hello!". Don't run on a live site!
function twentythirteen_child_change_title() {
remove_filter( 'wp_title', 'twentythirteen_wp_title' );
add_filter( 'wp_title', 'twentythirteen_child_title', 10, 2 );
}
add_action( 'after_setup_theme', 'twentythirteen_child_change_title' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment