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

learn more… | top users | synonyms

3
votes
1answer
2k views

how to check if front page is set to show a static page

I need to determine whether the reading settings are set to use a static page or the latest post for the front page. Is there a conditional that will return true if the front page is set to show a ...
0
votes
1answer
384 views

Help with adding conditional title tags to header.php

From an SEO perspective, i'm trying to add conditional title tags to my WP theme such that it echos a piece of text based on various categories. Assuming that my category id's are 1, 2, 3, 4 Then ...
1
vote
1answer
427 views

is_page() conditional not working inside an AJAX function

I have a jQuery ui tabs that load posts via ajax on sidebar. Now in a specific page i want to filter the query post via is_page(); conditional. But in my case its not working. function ...
1
vote
2answers
2k views

functions.php conditional tag only for custom post type

I'm using gpp slideshow, which overwrites wordpress's default gallery display. I only want to use it on my custom post type, "listings" - how would I reference it to only replace wordpress's default ...
1
vote
3answers
862 views

Is there a way to check which template file is being loaded, if it is not a page template file?

I don't see any way of testing which template file is being loaded, if the template file is not a page template. Otherwise I would use is_page_template(). For instance, I am using a home.php template ...
0
votes
1answer
183 views

Conditional Tag Custom Querys?

I think thats what its called... Basically a conditional statement if there are any posts in a specific custom post type/custom taxonomy, show posts, it not show an img or include whatever…? But ...
0
votes
1answer
389 views

How to display a feature only if custom field value is set?

What i'm trying to do here is to modify the existing wp-postratings plugin. The function to display the ratings is: <?php if(function_exists('the_ratings')) { the_ratings(); } ?> However, the ...
2
votes
2answers
3k views

How To Remove The Author(s) From Certain Posts

There are certain posts on the website I'm developing, that don't need the author(s) by-line. (such as press releases) Is there any method, that allows me to remove the author (and co-authors) for ...
0
votes
1answer
1k views

using get_the_category to get all post categories except one

foreach((get_the_category()) as $cat) { if (!($cat->cat_name=='Featured')) echo $cat->cat_name . ' '; } this is what has been recommended in the forums but its not working for me. I need to ...
0
votes
1answer
216 views

Detect tag page and include an Image for that specific tag

I'm trying to figure out a way to include a div(which will contain a background image) for a specific tag. This block of code works but fails when a post has more than 1 tag. I'm using a page called ...
1
vote
2answers
1k views

Conditional Query of Custom Post Type and custom taxonomy

I am working on a project that has a custom post type called 'Experience Statement' Custom Taxonomy attached to that post type called 'Expertise' 6 different terms for the custom taxonomy: Coastal, ...
10
votes
2answers
3k views

Toggle admin metabox based upon chosen page template

I'd like to have a custom field interface show up only when a certain template is assigned to a particular WordPress page. Any ideas?
0
votes
2answers
174 views

Trying to use Ternary operators with WP Conditionals

Hi I am trying to use ternary operators with WordPress condtionals, using the code below, but it's giving me a PHP error, what am I doing wrong? echo is_home() : '1' ? '0';
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
776 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
257 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
770 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.
15
votes
2answers
8k 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'] ?
32
votes
6answers
84k 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 ...