Skip to content

Instantly share code, notes, and snippets.

@keirwhitaker
Created May 21, 2012 10:01
Show Gist options
  • Save keirwhitaker/2761605 to your computer and use it in GitHub Desktop.
Save keirwhitaker/2761605 to your computer and use it in GitHub Desktop.
WordPress Page Template Snag Lists
<?php
// Add the filter and function to your functions.php file
add_filter('body_class', 'add_slug_to_body_class');
function add_slug_to_body_class($classes) {
global $post;
if(is_page()) {
$classes[] = sanitize_html_class($post->post_name);
} elseif(is_singular()) {
$classes[] = sanitize_html_class( $post->post_name );
};
return $classes;
}
?>
.msg { background: #9CE783; border-bottom: 5px solid #006600; padding: 1em; font-size: 1.2em; text-align: center; color: #444; }
.msg p:before { content: 'TO DO: '; font-weight:bold; }
if( $('body').hasClass('home') ) {
$('body').removeClass('blog');
}
var todo = {
'home' : 'This is the home page to do message',
'services' : 'Add in editable fields (kw)',
'insites-the-tour' : 'Add in editable fields (kw)',
'blog' : 'Add in responsive JS to cater for colour image (kw) // Style up related older posts (ejs) // Add in styles for no image header i.e. big text (ejs)',
'single-post' : 'Style up related posts and categories (ejs) // Add in styles for no image header i.e. big text (ejs)'
};
$.each(todo, function(i, val) {
if( $('body').hasClass(i) ) {
var msg = document.createElement('div');
$(msg).addClass('msg');
$(msg).html('<p>'+val+'</p>');
$(msg).insertBefore('.vi-bar');
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment