Created
May 21, 2012 10:01
-
-
Save keirwhitaker/2761605 to your computer and use it in GitHub Desktop.
WordPress Page Template Snag Lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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