functions that return a single boolean value depending on what is currently being viewed
0
votes
2answers
344 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
62 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')): ?>
...
2
votes
1answer
164 views
Bulk add tag (or any sort of label) to posts who have custom excerpt
The situation is the following:
The blog as of now has 2200+ posts. In the beginning (2007/2008) I was using manual excerpts where I would put an image and a little bit of text. The manual excerpt ...
1
vote
1answer
206 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
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
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
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
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 ...
0
votes
1answer
48 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
28 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
124 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
64 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
116 views
Category Template: Need to display different content on first page of archives
So my issue is that I need to create two versions of a category.php template. Now, I know very well that if I want to display posts from just one category, I duplicate category.php and call it ...
0
votes
1answer
111 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
66 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
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
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
0answers
43 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"] == ...