How can I achieve something like has_post_format( ‘standard’ )?

In opposite to get_post_format, the conditional has_post_format() function returns a boolean value and should be the perfect function for a conditional check like: if ( has_post_format( array( ‘gallery’, ‘image’ ) ) { // I’m a gallery or image format post; do something } (see this answer) Unfortunately, has_post_format() is not sufficient to check for the … Read more

How can i know when i can execute what functions of wordpress?

I like to do a bunch of stuff only on homepage and archive pages i am working with the genesis framework (not really matters i guess) if( is_singular() ) { wp_die(‘functions.php’); } add_action( ‘init’, function() { if( is_singular() ) { wp_die(‘init’); } }); add_action( ‘genesis_before’, function() { if( is_singular() ) { wp_die(‘genesis_before’); } }); only … Read more

is_active_sidebar() Always Returns False

I’ve never gotten is_active_sidebar() to work, no matter if there’s widgets in the sidebar or not I always get false returned. Currently I’m creating a sidebar for each top level page: http://pastebin.com/fX3Rv20f I create my own widget(s): http://pastebin.com/Bz9hv41z And I’m testing whether the sidebar is active like so: if(is_active_sidebar(get_the_title())) echo ‘active’; else echo ‘not active’; … Read more

Adding Filter Conditionally Per Page ID

I’ve created a function to add a class to the body, however if should only apply to a single page ID. This normally wouldn’t be a problem, but it is breaking the layout for other pages. Filter Function add_filter(‘body_class’,’add_blog_to_body_class’); function add_blog_to_body_class($classes) { $classes[] = ‘blog’; return $classes; } My Condition (that isn’t working) function add_blog_to_body_class($classes) … Read more