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

learn more… | top users | synonyms

0
votes
1answer
33 views

Disable CSS for IE 8 and earlier.

I am trying to find a way to disable the twenty twelve stylesheet for anything in IE 8 or less. Is there a conditional code that I can put in my functions php file that will enable the default ...
0
votes
2answers
32 views

Set conditional on template based on referring page slug

I have a portion of a page template that is conditional upon the following elseif <?php elseif( isset( $wp_query->query_vars['details'] ) && $wp_query->query_vars['details'] == ...
0
votes
1answer
14 views

How to get type of archive whether it is post or date or category archive?

using function is_archive() we can know whether it is archive page or not. But if it is archive page how can i find whether it is author archive page or category archive or date archive. I have ...
1
vote
2answers
65 views

Output 2 items within the Loop

I have a query that loops through <li>'s and displays the number of <li>'s I have. Is there a way I can make the loop pull 2 <li>'s at a time rather than one? // 5 list items ...
0
votes
1answer
16 views

If 'editor' is empty, then

Is there a way to write a php conditional in WordPress that says: "If 'editor' is not filled out (i.e. empty), then, do some code..." I know it's sort of a strange request but basically I have a ...
0
votes
1answer
23 views

Custom Function for Portfolio Archive Template With Conditonal Tag

Can't work out which conditional tag to use to add a page title to the portfolio archive page which uses custom posts types. This doesn't work: if( is_archive('portfolio') ) echo '<div ...
0
votes
0answers
26 views

Custom Post Query Combined with Conditional Tags

Is it possible to combine displaying a list of custom post types on a single page depending on conditional tags? Below is what I have so far, basically if there are 4 posts or less show the posts, if ...
0
votes
1answer
31 views

Conditional menu display

I have the line of code below with the intention to display the called menu in every other page except the home page but it still shows up on the home page. Any ideas what the problem could be. ...
-1
votes
1answer
29 views

How can i hide content if not friend in Buddypress?

How can I hide some specific contents or div or other stuff depending on being friend or not in buddypress ?? I tried to use the bp_is_user_friends() function but it did not work !
0
votes
1answer
18 views

Conditional display faults

I'm trying to get the line of codes below to display it's content on "web-design-portfolio" and "web-design-portfolio-2" but it ends up messing up every other pages on my website and displays the "Ul" ...
0
votes
0answers
21 views

Conditional stylesheet based on if there is a featured image returning error [unexpected end of file] [closed]

I am trying to set a custom stylesheet based on if there is a featured image or not but i get this error: Parse error: syntax error, unexpected end of file in ...
-1
votes
1answer
158 views

Woocommerce getting top level category parent and make all sub categories have the same template and menu

I want to get the top level category parent which is "wedgwood" so i give it a different menu and different template that what i wrote so far but it dont apply except on ‘wedgwood’ category wegdwood ...
0
votes
0answers
23 views

Combining Custom Tax Conditionals and Custom Querys?

The following has a custom post type of features, within that a custom tax called feature-type with three categories, template-1, template-2 and template-3. Each custom post feature needs to select ...
0
votes
2answers
19 views

If, elseif, elseif, else [closed]

is this totally borked or am I on the right track? <?php if ( function_exists( 'meteor_slideshow' ) ) { <?php if ( is_page( '34' ) ) { ?> meteor_slideshow( "tanning", ...
1
vote
1answer
71 views

How to insert widget areas specific to certain pages (or posts, etc.)?

I am developing a theme the pages of which (as well as posts) are so different from the home page that I want different widgets on their sidebars.Is there a way to do it? I'm calling the sidebar on ...
0
votes
1answer
24 views

Combine get_post_meta conditional statements? [closed]

Is it possible to combine two get_post_meta conditional statements? Currently i have a couple of metabox checkboxes which turn things on and off and it works fine... <?php if ...
0
votes
2answers
41 views

Show specific content on parent custom post type and all children

I have 5 main posts within a custom post type. Some of these posts will have children. I have content that should only be displayed on the parent post and all children of that post. What's the best ...
0
votes
0answers
15 views

conditional tags [duplicate]

I am playing around with the widgets page and have added a google maps feature to the "Pages Sidebar" Tab. the google maps feature displays on the contact page, my account page and messages page. ...
0
votes
1answer
91 views

Check if current page is wp-admin

I have created a common custom dashboard for my users located at "http://website.com/login/dashboard/" I'm trying to redirect users to that custom dashboard only if they are NOT admins & if the ...
0
votes
0answers
44 views

Widget Display Options

in regards to my previous question. I am playing around with the widgets page and have added a google maps feature to the "Pages Sidebar" Tab. the google maps feature displays on the contact page, ...
0
votes
0answers
50 views

How can i add in this code the ALT , to validate the image

How can i add in this code the Alt title for image.. This is in Php Code ( modification) $new_rows = array(); foreach ($all_rows as $row) { if ($widget["image_from"] == ...
0
votes
1answer
192 views

Add class to DIV depending on page loaded

I'm designing a new theme and in my page template a have a section where an image is displayed . I would like this image to change depending on which page is loaded. The section is a DIV like this: ...
0
votes
1answer
90 views

How to use is_feed() to target a category feed?

is_feed (one of the many conditional tags) can be used to determine if the current query is for a feed. But how do I use it to target all category feeds? (or tag or custom taxonomy feeds for that ...
0
votes
1answer
64 views

How to echo a different field if another field is empty?

I succeeded in getting both images and video to echo into a bootstrap carousel. However, I run into a problem when the post contains no images. If there are no images then there is no class="item ...
0
votes
1answer
60 views

Wordpress function like is_category for subcategory? is_subcategory?

Is there a function in WordPress that will check if the page you are on is a sub-category archive page? Like the way is_category checks if it's a category page?
0
votes
2answers
62 views

Excluding custom post types

I'm attempting to develop an is_blog() function which returns true if the current view is a single post, blog home, or post archive. I have successfully excluded pages and attachments. My current code ...
0
votes
1answer
44 views

Adding else if conditional statement to purchased theme

I purchased a theme that I want to change a bit. I'm familiar with writing some if/else statements but not this type and not matter what I do, I can't add an else/if without breaking the code. Below ...
1
vote
0answers
67 views

bbPress: How to set conditional for specific user -or- user role, to be displayed in user profile

I've been trying to set a conditional for specific users (e.g. http://www.mywebsite.org/forum/users/john/) to display a custom "Contributor" graphic within their user profiles. The graphic would be ...
0
votes
1answer
132 views

Conditional based on the User Role of the Current Profile the user is viewing - BuddyPress

I'm using BuddyPress and need a certain block of code to show up on user role Store Owner profiles only. I'll be putting it in member_header.php, so it's just a template file. I've been digging for a ...
0
votes
1answer
79 views

is_home() in HTML head

Is there a way to check if the current page is the home page from within the head? My style.php needs the number of posts in the slider, but only on the home page. So I count my posts like this: ...
0
votes
2answers
157 views

How to check with is_page if 404.php is loaded?

I want to check if current page match at least one of two conditions. I don't want to show js code into about page and into 404 page. For the rest of my pages i show the js code. So, I use ...
0
votes
1answer
38 views

is_mobile as shortcode

I installed the Plugin "mobble" which provides some more conditional tags. As I want to hide some content for mobile devices I tried to build a shortcode [is_mobile]. But I tried many different ways ...
2
votes
1answer
30 views

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'); } ...
0
votes
1answer
68 views

Checking whether template part is loaded in a page

I have a template part like this: <nav id="subpagemenu" class="sidebar"> <?php get_template_part( 'nav', 'subset' ); ?> <?php get_sidebar(); ?> </nav> Both of these ...
0
votes
1answer
25 views

Conditional Custom Image Header

I thought there was a conditional for a custom image header that could check whether an image had been added (not whether the feature was enabled, but actually being used). I wanted to use it to add a ...
1
vote
1answer
44 views

Taxonomy Tag Conditionals

I'm using jigoshop as main ecommerce plugin. Jigoshop use Taxonomies call, product_cat and product_tag. In my theme I use a default (h5bp) 404.php, so every time a tag doesn't exist I get the ...
0
votes
1answer
66 views

Conditionals: What is wrong with my if/else statements? [closed]

<?php if( $settings['logo']) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img ...
0
votes
1answer
96 views

Trying to place shortcode/css/html into an IF conditional statement

With the WooCommerce plugin, I'm trying to get a different template/look to apply to the individual product page depending on what category the product is in. In other words, I want a product within ...
0
votes
1answer
40 views

Only on single post page

I am using this code to show ad below single post but only if it is in specified category. Code is giving right out put but it is also showing up on archive pages. I just want to show on single post ...
0
votes
1answer
73 views

Conditional tag to determine if the user is viewing the Add Media (after clicking Add media button)

Is there a WordPress conditional tag for checking if the user is viewing the add media popup after clicking the Add media button? If none, is there an alternative function that can be used? Thanks ...
-1
votes
1answer
53 views

Quick Conditional Tag Question if elseif [closed]

I have a meta box checkbox, you click to turn on/show the blow info basically... These conditionals dont seem to be working for some reason, the first if works, but when i add in any other else if it ...
0
votes
2answers
63 views

page 1 is not paged

I have rules that only work on paginated pages (is_paged). However, they don't work on page number one (/page/1). This one is behaving exactly like the homepage (!is_paged), but unlike pages 2,3,4 ...
1
vote
1answer
126 views

How can I hide tags on a child-category page, if that tag has not been used?

I have a section of my site where I'm using child-categories and tags to sort content. I'm have a tertiary navigation for the tags (templates/nav-tags.php): <nav class="side left"> <ul ...
-1
votes
1answer
30 views

problem with not displaying content on selected pages

My objective - Display some code on every page apart from 2 pages. Now this code works fine with only one page (if its not is_home, display code)... <?php if (!is_home()) { ?> (some ...
0
votes
1answer
71 views

Showing code only on Front Page “Posts Page”

I have some code that I would only like to be displayed on the sidebar when on the blog (the page that displays the posts). Now I am using this code... <?php if(is_page('37')) { ?> ...Show ...
-1
votes
1answer
74 views

hide block of code from showing on certain pages

Just to warn you, I am a complete PHP novice! I have one sidebar for all pages, however I would like to display certain elements on this sidebar for certain pages. I know there are a few widget ...
0
votes
1answer
104 views

Detect if request is coming from wordpress conditional statement

I don't even know if this is possible and my search terms in google are not doing any good. Since the site URL and blog URL are different I had to fix the post preview bug by giving wordpress it's ...
0
votes
1answer
59 views

Show posts containing or not custom field

I'm trying to show aditional posts in the author's page. This page must have posts containing a specific meta_key and meta_value, where the displayed author it is not really the WP post's author. ...
-2
votes
1answer
71 views

Weird html output of single_cat_title - is not inside of the html element?

I'm displaying a single "featured" post at the top of the blog index page, and category pages. I'm using this conditional to display the category name of the category page if it is a category page, ...
0
votes
2answers
144 views

Using has_tag() outside loop

I want to if the check next post has a specific tag. I tried the following code, but it is not working because has_tag() only works in the loop. I want to use it outside the loop. <?php if ( ...

1 2 3 4