Skip to content

Instantly share code, notes, and snippets.

@norcross
Created August 13, 2012 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norcross/3343491 to your computer and use it in GitHub Desktop.
Save norcross/3343491 to your computer and use it in GitHub Desktop.
Mod title
<?php
function amm_change_title($title) {
global $post;
$type = get_post_type( $post->ID );
$slug = basename(get_permalink( $post->ID ));
if( 'page' == $type && 'title-test' == $slug )
$title = esc_attr( 'My Awesome Title' );
return $title;
}
add_filter( 'the_title', 'amm_change_title', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment