is_archive for custom tax archive page?
shouldn’t it be is_tax(‘article-area’)
shouldn’t it be is_tax(‘article-area’)
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>’; } ?>
Try this: <?php if ( ‘0’ != $post->post_parent) { include ‘siblings.php’; } ?> !== refers to an exact type match too. So your code doesn’t work because the post id is stored as an integer. != will disregard the fact that you are comparing a string to a number. Hope this helps. You could also … Read more
Have a look at the is_page() conditional tag and at conditional tags in general. is_page() takes both post IDs as well as slugs (and more) as arguments, hence you can choose how you’d like to identify the page in question. With the above given ID, this, for instance, ought to work: if( function_exists(‘cp_alterPoints’) && is_page(24122) … Read more
Got it! Turns out I should be using is_home which seems to work. More info here.. http://codex.wordpress.org/Conditional_Tags#The_Main_Page
Add following function into your functions.php file: function is_child_of() { global $post; return is_page() && in_array( $post->post_parent, func_get_args() ); } And use it in your template like this: if ( is_child_of( 5860, 1047 ) ) { // is child of 5860 or 1047 }
Just a simple logic error. You want to display the header if you’re not on the front page AND if you’re not on an author page. if(!is_front_page() && !is_author() ) {
Technically, this should work: <!–display image–> <div class=”featured-image”> <?php $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts( $args ); if ( $attachments ) { foreach ( $attachments as $attachment ) { echo wp_get_attachment_image( $attachment->ID, ‘full’ ); } } ?> </div> <?php $content = preg_replace(‘/<img[^>]+./’,”,get_the_content()); … Read more
I do not know much about how $[‘globals’] decides what browser you are using, i assume it uses some kind of browser sniffing which is generally a bad technique as the results it produces can be less than reliable. Why do you need to use PHP anyway, just putting this as HTML in the head … Read more