1
vote
1answer
152 views

Search filter triggered & sort by custom post type

I am using a plugin (Relevanssi) and a custom function to sort the search results by custom post types (see below). This is working great. add_filter('relevanssi_hits_filter', ...
0
votes
1answer
444 views

If custom taxonomy else conditional [closed]

I have a menu that I only want to show on certain pages using the following code: <?php if ( is_front_page() || is_archive() || is_404() ) { } else { if ( function_exists('has_parent') ) { ...
-2
votes
2answers
93 views

How to set up a echo? [closed]

My problem is that i don't know how to set up a echo I think. I need it to just wrap a if statement correctly around the code below Please Help...Thanks SO much <?php global $post; ...
0
votes
2answers
114 views

Check IF single OR multiple custom data has been entered

I'm building a single template right now for a custom post type. I'm wondering if there is a way to check if either at least one or multiple of the custom values has been entered so I can display the ...
0
votes
1answer
104 views

Conditional for a Single Post That Belongs to a Category?

I have categories like gaming and movies on my website and when a user visits any of these categories the content in the sidebar is displayed depending on the category they are in. So gaming content ...
0
votes
1answer
224 views

Exclude custom function content from certain pages

I have added a small custom function to display a little author bio blurb at the bottom of each blog entry in my functions.php file inside the current theme that I am using. So far so good, it is ...
0
votes
2answers
365 views

Loop to pull content from parent element in custom post type [duplicate]

I created a hierarchical custom post type called "films." It is hierarchical so it can have children elements. I am using a conditional statement in my single-films.php to show different content for ...
2
votes
3answers
5k views

If Post Type equals, then display X content

I just need to say in single.php if post type = x then display y. Else, don't display it.
0
votes
2answers
439 views

Dynamically output a class to an anchor tag depending on what tag is chosen

Not sure if this is possible, but what Id like to do is have the ability to output/add a class to an anchor tag depending on what tag I choose when creating the post. My reasoning behind this is to ...
0
votes
1answer
112 views

Checking for custom field in admin pages

I am loading some scripts conditionally for the admin section with : if (is_admin()) { wp_register_style('admin_js', get_bloginfo('template_directory') . '/admin.js'); ...
1
vote
2answers
851 views

Function like in_category for custom taxonomies

I'm trying to display different content depending on the taxonomy that was been selected. For example I have a taxonomy named Type. Inside that taxonomy I have several different children, one is ...
22
votes
6answers
60k 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 ...
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
516 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 ...