The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
117 views

Search result conditonal tag

Is there a conditional tag (or a similar concept) that can tell me wether the search returned posts or not?
0
votes
1answer
178 views

Do not run this code on posts with a specific tag!

This is sort of complicated. I am looking for some php help related to WordPress blog. The basic requirement is that some HTML code (ad code) is not supposed to run on posts with a specific tag. ...
0
votes
2answers
317 views

Return function only on certain pages

I'd like this function to only return on certain pages. How might i do that? // Retreats Accordion function retreats_accordion() { ?> <!-- accordion root --> <div id="accordion"> ...
21
votes
6answers
57k 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 were I could do ...
5
votes
2answers
4k views

how to create a conditional content_width for a wordpress theme?

I'm trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have 900. This will make the oEmbed ...
3
votes
1answer
687 views

Loading Javascript Only When Specific Content Existing in a Post?

I'm trying to add Javascript for my "PrettyPhoto" plugin to pages only when their content contains rel='prettyPhoto'. This looks very simple to me but all solutions I've found on the internet doesn't ...
1
vote
3answers
618 views

How to Add Javascript Only When a Function Exists?

I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my ...
1
vote
1answer
618 views

Can I create a loop with multiple post types and specify different $args for each post type?

I'd like to create a custom loop that includes all Post types: Post and Video. Then I'd like to specify to show all posts of the post type Video, but only show posts that are in the category ...
1
vote
1answer
159 views

How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?

Often times, a custom theme for Wordpress will require a dynamic content that reflects a relationship to a top level page of a site. Is there a Conditional Tag that will check if the current page is ...
1
vote
2answers
2k views

How to tell if the user is an admin?

I need to show some info only to admins visiting a page, so I need a conditional tag to identify them. So far I have found: <?php if ( current_user_can('manage_options') ): ?> is this the ...
1
vote
1answer
514 views

Conditional PNG Overlay in Custom Post Type Loop Depending on Post Type

I have a loop pulling in two different custom post types. I have that loop showing the thumbnails of posts. Each post type used to have its own seperate loop and I had set up some png overlays to ...
2
votes
1answer
1k views

Checking if a Page has an Associated Term?

I am looking for a way to do some conditional logic on terms associated with a post. Essentially I created my own custom taxonomy for "age groups" and have created three terms for them. Kids, Teens, ...
0
votes
1answer
294 views

Target pages using a specific page template

I need to target all pages using a specific page template with a conditional tag (like is_page()). Anyone done something like that before?
9
votes
3answers
7k views

Loading scripts only if a particular shortcode or widget is present

I needed a way to filter a page/posts content before it was loaded so I could add scripts to the header if a specific shortcode was present. After much searching I came across this on ...
3
votes
3answers
91 views

How do I place content on archive pages but not on main page?

I would like to place content in a sidebar of my blog articles when they are viewed in the archive, but not show this content when the blog articles are shown on the main page of my site. Can this ...