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

learn more… | top users | synonyms

0
votes
4answers
105 views

Function to echo (or display?) wordpress tags in the head section

I can't figure this out but I'm trying to echo the post Tags of the post in the <head> section. This code resides in the <head> section of the site. Basically I want the post tags to ...
1
vote
2answers
21 views

Conditional IF statement not returning true even though echo of $user->province is correct

I am having a problem with an if statement which I have now tested many times over. $user_query = new WP_User_Query( array( 'role' => 'Subscriber' ) ); if ( !empty( ...
1
vote
2answers
362 views

Conditional tag in Widget Logic for checking if top level page or if subpage

I'm using the Widget Logic plugin to show widgets on certain pages using Wordpress Conditional Tags (or any general PHP code). What I would like to do is only show a widget on child pages, not top ...
0
votes
2answers
919 views

Conditional tags issue for multiple is_page() conditions in sidebar.php

I've been pulling my hair out today trying to get this right. Basically I have a sidebar, which makes requests to individual files (such as sidebar-home.php, sidebar-residential.php) and different ...
2
votes
1answer
105 views

Featured Image Size Conditional Tag?

Is it possible to check what image size has been selected for the featured image and only display that image.. For example. <?php if(has_post_thumbnail('small-image')): ?> ...
1
vote
1answer
96 views

Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms

I am using Isotope to filter posts on the fly from my archive pages. I have a Custom Post Type called "art". On the sidebar, I've created links to yearly archives on my sidebar, i.e. 2014, 2013, ...
1
vote
1answer
249 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: ...
1
vote
1answer
286 views

Check if page/post has any anchors that link to an image jpg/gif/png

What I'm aiming to do is add fancybox to a site I'm developing, but I only want to enqueue the JS/CSS etc if the page/post needs it. My thoughts are that I would need to check all the anchor tags on ...
0
votes
1answer
23 views

How can I hide the category term for posts with none set?

I'm trying to hide the word "Category:" from the metadata on the Twenty-Eleven theme's footer, when I don't have one set for a given post (sometimes I will manually remove the "Uncategorized" ...
0
votes
1answer
39 views

Need a conditional to test if title of parent page matches title of child page

In my main loop, I need to incorporate proper html markup into a conditional to test if title of parent page matches title of child page and do (or do not) display certain content. Default might be ...
0
votes
1answer
18 views

How to check if the current page's parent is one of 2 different ID's

I'm using this little snippet right now to check if the current page is the child of a particular page; $studies_parent = 5860; if ($studies_parent == $post->post_parent) { Which is working ...
0
votes
1answer
636 views

is_search not working on search results page

Having an extra submenu with this code in sidebar: <?php if(is_404() || is_search()) : ?> <?php echo 'zou leeg moeten zijn'; ?> <?php else : ?> <?php if($post->post_parent ...
0
votes
1answer
196 views

If tag exists and equals then

I have the following code and I'm trying to check to see if a specific tag exists and if so I need it to be echo'd once. The problem I'm having is when the tag exists multiple places it gets echo'd ...
0
votes
1answer
230 views

WooCommerce - Conditional loading different header & nav based on product category

All I'm trying to do is conditionally load different items in the header, or, if need be, a different header (header-this_category.php or whatever) for single products in a certain category. I know I ...
0
votes
1answer
121 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
1answer
61 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 ...
0
votes
1answer
78 views

Run a php function if a predefined page is visited

I use the CubePoints plugin that rewards users with 1000 points via the following function: if( function_exists(‘cp_alterPoints’) && is_user_logged_in() ){ ...
0
votes
1answer
40 views

Targeting all pages except top level pages

I have used '0' == $post->post_parent successfully in my templates to target top level pages. However, I cannot seem to target all pages EXCEPT top level pages: <?php if ( '0' !== ...
0
votes
1answer
147 views

Display Latest Post on a Page Conditionally

So I'm wondering exactly how I could display my latest post on a page only in certain conditions. I've been looking over the conditions page in the codex, but I'm not seeing how I could do what I have ...
0
votes
1answer
94 views

Display a widget on a specific type of archive

I have two sidebar widgets, I need to display 1 widget on the archive pages for the standard post categories and the other widget needs to show on just the archive pages for a specific custom post ...
0
votes
1answer
263 views

wp_enqueue_scripts called twice?

I had some problem with WP recognizing a is_single condition for loading scripts called in function.php. I put a error_log(is_single()) to check what was going on. When opening a post page the log ...
1
vote
0answers
136 views

Auto Add Image Title,Caption,Alt Text,Description while uploading Images in WordPress

Can anyone tell me how to auto fill/add same image title in title, caption, alt text and description while uploading any image in my WordPress Posts.
1
vote
0answers
155 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
0answers
25 views

conditionally display text - on nextGEN gallery pages only

I'd like to use functions.php to display some text via a hook on pages displaying a nextGEN gallery. I can't find any documentation for nextGEN code. something like: // add note to nextgen gallery ...
0
votes
0answers
21 views

Multiple Plugins Interacting with Menu

Got an issue with the use of multiple plugins interacting with the menu system in WordPress. We are using UberMenu and wanted to use If Menu as well to control the visibility of some of the menu ...
0
votes
0answers
40 views

Diffrent search templates for different post types

I have a site with diffrent post types. Two of them are the 'post' post type and the other one is 'charity', for both pages I have an index, the normal index.php and a diffrent page template for ...
0
votes
0answers
41 views

admin-ajax.php nulls all php variables

I have a problem in a custom function. The function which adds to the WHERE clause in Store Locator Pro works correctly on its own, but I only want it to only work on a certain page, not on all my ...
0
votes
0answers
14 views

Conditional to use 'full' image size with animated GIFs

I am using ACF and pulling images into my category archives via ‘wp_get_attachment_image_src’ like this: <?php $image = wp_get_attachment_image_src(get_field('image'), ‘grid’); ?> <img ...
0
votes
0answers
46 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
0
votes
0answers
48 views

Detect Page Template inside Loop possible?

I'm a bit stuck with my actual theme development. I'm using different Blog Templates to choose from. Now each of those Blog Page Templates has a custom loop to pull the posts. Inside that loop I use ...
0
votes
0answers
40 views

Change conditional tag in wordpress without editing the core files

In wp-admin/includes/class-wp-posts-list-table.php lines 59-69: if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { $exclude_states = get_post_stati( ...
0
votes
0answers
139 views

Different types of quantities (Weight - kgs, units)

I'm developing a shop that sells meat, poultry and similar items. From the knowledge I've picked up on the internet I understand that the best way of working with products that are purchased by ...
0
votes
0answers
97 views

is_page() is not executed

I am making infinite scroll page. I created a page template where posts of certain category are loaded. Everything works fine with a single page and single category. But I have three pages with this ...
0
votes
0answers
39 views

Conditional before_widget and after_widget

Is it possible to use a custom before_widget and/or after_widget value for certain widgets? For example, I'd like to add a opening <div> tag before the first and closing </div> tag after ...
0
votes
0answers
67 views

how I can show tag cloud for specific product category?

In woocommerce plugin, how I can list tags according to product category in a widget? for example I want to show laptop's tags in sidebar when user going to laptop products category. Thanks
0
votes
0answers
226 views

is_home() and is_front_page() not working in sidebar

I'm trying to display a custom widget in the sidebar of my homepage (which is a static front page defined in Settings > Reading). Here is the relevant part of my sidebar.php: if ( is_front_page() ...
0
votes
0answers
21 views

Template is different with and without comments

My referenced website is at http://angelopardo.com/wakeupbeast and I've built it as a child theme of twentytwelve. Pages and single posts that have comments are displaying correctly, where the ...
0
votes
0answers
60 views

Conditional logic for the new 3.6 structured post formats

Currently i have couple of custom fields in a custom metabox for post format options, like link url, video embed code etc... This works fine in version 3.5 and below. Now, with the new soon to be ...
0
votes
0answers
69 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
0answers
49 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 ...