How to apply style to the body tag of a particular page?
from your verbal desription, i would think this should work: <?php if ( is_single() OR is_page(‘171’) ) : ?> <body class=”last-page”> <?php else: ?> <body> <?php endif; ?>
from your verbal desription, i would think this should work: <?php if ( is_single() OR is_page(‘171’) ) : ?> <body class=”last-page”> <?php else: ?> <body> <?php endif; ?>
You can use the have_posts function. For more information, visit The Loop <?php $loop1 = new WP_Query( array( ‘post_type’ => ‘profile’, ‘profile-type’ => ‘featured’, ‘posts_per_page’ => ‘-1’ ) ); $loop2 = new WP_Query( array( ‘post_type’ => ‘films’, ‘film-type’ => ‘featured’, ‘posts_per_page’ => ‘-1’ ) ); if($loop1->have_posts()) { while($loop1->have_posts()) { $loop1->the_post(); // content here } } … Read more
See codex page for category conditional tags – http://codex.wordpress.org/Conditional_Tags#A_Category_Page You can use them like so: <title> <?php if ( is_category( ‘1’ ) ) echo ‘This is the news category’; ?> </title>
shouldn’t it be is_tax(‘article-area’)
Figured it out. Just need to add $post_id to the template tag like so. if (in_category(‘videos’,$post_id)) {
I had this same issue. I logged the request URI and discovered that the additional call was for a file that didn’t exist (that’s what I get for copying and pasting a bunch of code from one project to another). I created a file at the expected name and location, and the additional call to … Read more
is_tree returns true or false, passing false to is_page will always return true. I don’t think this does what you expect it to: !is_page( array(‘189′,’24’,’36’,is_tree(’24’),is_tree(’36’)) )
Possibly you could wrap the code on the vendor’s page in a comparison. So if the vendor’s name is the Title of their page, and the newest post has a meta field that hold’s the vendor’s name, it could look like this: $my_most_recent_post = get_posts( ‘numberposts=1’ ); $my_most_recent_post_id = $my_most_recent_post[0]->ID; // Get the featured item’s … Read more
I believe this should do what you want: <?php if ( has_post_thumbnail() ) { echo ‘<div id=”venue-single-img”>’; the_post_thumbnail(); if ( get_post_meta($post->ID, ‘Venue Image Notation’, true) ) { echo ‘<span>’ . get_post_meta($post->ID, ‘Venue Image Notation’, true) . ‘</span>’; } echo ‘</div>’; } ?>
Okay, that was quite easy. So, if your custom feed URL (non-pretty) is http://example.com/?feed=wpse63760_custom_feed, then the conditional tag would be used as such: if ( is_feed( $feeds=”wpse63760_custom_feed” ) ) { // So what’s the conditional content? } else { // This is shown everywhere else }