functions that return a single boolean value depending on what is currently being viewed

learn more… | top users | synonyms

0
votes
1answer
197 views

How to apply style to the body tag of a particular page?

I have the following code: <?php if ((is_home()) OR (!is_single()) OR (!is_page('171'))) : ?> <body> <?php else: ?> <body class="last-page"> <?php endif; ?> ...
1
vote
1answer
762 views

functions.php conditional tag - only show in single.php?

//Geo Map add_action( 'woo_post_inside_after', 'my_geo_mashup' ); function my_geo_mashup() { global $post; if ( in_category('listings') ) { echo GeoMashup::map(); } } Works to ...
0
votes
1answer
256 views

hard code shortcode only on specific category

I am looking to embed several shortcodes into my post template, but I want the tags to be conditional to a specific category (and subcats). I've looked through the codex, but I'm unsure where to ...
0
votes
2answers
748 views

Wrap the_title_attribute in a H2 within a Conditional Tag?

I have the following that works fine.. elseif( get_post_type($post->ID) == 'press' ){the_title_attribute();} However, i need the aforementioned title to be wrapped with a h2 tag. Tried this but ...
-1
votes
2answers
104 views

Delete backgound for ID with conditional if statement

how can I delete a background for #main only on my posts. I know that I have to create a conditional if statement in my functions.php file with if (is_post()) but I'm just not sure how to write it.
13
votes
2answers
7k views

Check if we're on the wp-login page?

How can I check if the current page is wp-login.php or wp-signup.php ? Are there more elegant solutions than using $_SERVER['REQUEST_URI'] ?
27
votes
6answers
78k views

If is custom post type

I am looking for a way to test if a post is a custom post type. For example, in say the sidebar I can put code like this: if ( is_single() ) { // code here } I want code testing for only a ...