You can achieve that by changing the conditional to
if ( !is_home() && !is_archive() )
Also consider using if
and else if
. So your optimized code would be:
<?php
if ( !is_home() && !is_archive() ) {
if ( get_post_type() == 'pretty-little-liars' ) {
echo '<div id="headerimg"><img src="http://tv-cafe.com/wp-content/uploads/2013/01/pllbanner.png"></div>';
} else if ( get_post_type() == 'revenge' ) {
echo '<div id="headerimg"><img src="http://tv-cafe.com/wp-content/uploads/2012/08/revenge.png"></div>';
} else if ( get_post_type() == 'grimm' ) {
echo '<div id="headerimg"><img src="http://tv-cafe.com/wp-content/uploads/2013/01/girmmbanner.png"></div>';
}
}
?>
Related Posts:
- Menu’s breaking, now showing all page links on site
- Filtering a custom post type by custom taxonomy in archive template
- Why are posts from custom post type not displayed in “category” archive?
- Displaying category archive of custom post types
- Load custom posts with same tag as page
- Date archives for custom post type
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Regex problem in an add_rewrite_rule
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Category page only displaying the posts from a custom type
- custom taxonomy archive by year
- Return array of categories to php function for current post
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- CPT Archive with core Category
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Get posts from a custom post type by child categories of a parent category
- Custom Post Type Archive Page Filtering
- get the custom post type title/name
- Get parent categories of custom post type
- Custom post type – get_day_link()
- Make a custom_post translatable
- Category.php template for custom posts
- Archieve.php not loading for custom post type
- multiple custom post type on category page
- WP_Query Custom Post Type if Category ID Equals
- Assign category a default post type
- Assigning a category to a custom post type in WordPress
- How do I add custom HTML to the content of an archive page’s posts?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Archive Template being used instead of Category Template for Custom Post Type
- Advanced archive url structure (category, tag and date)
- How can I increase the post count for custom post types only?
- WordPress sitemap with Custom Post Types
- Show the categories the current post has
- Display all Categories except ones with a specific parent
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom front-end form for adding post – Category problem
- In the php, how can I have a category of a custom post type display?
- Custom WordPress theme not displaying posts from category
- Do not show child pages within a file page
- Tell wordpress to show a single page instead of an archive page
- Get meta values from parent post and save in child post
- Custom Post By Category
- Adding Custom Post Types to category/tag/author archives breaks header content
- Custom category taxonomy – archive page not showing up
- How can I generate a list of post-type specific categories?
- can’t see categories in appearance-menu-categories
- Custom Post type archives / categories give 404
- archive.php can’t find categorized posts
- How to call Shortcode categories for custom post types?
- How can I set up the URL for a category archive for a custom post type?
- Categories in custom post types
- is_singular won’t call my functions?
- Add Category names to post lists of custom post type
- Get custom post type slug for an archive page
- How can I list all the categories under a Custom Post Type (taxonomy)?
- category__in not working on custom post type
- Ajax filter with custom taxonomies
- How can I add single catogory for custom post type?
- Custom post type loops with different page templates
- automatically save custom post type title as a category
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Dynamic Custom Post Type Plugin
- Link users to a custom post type
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Multiple level category drop-down from the WordPress dashboard
- Using custom field content as expression in IF statement [closed]
- WordPress showing archive.php instead page
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Get the category from custom post type
- How to create a gallery page with categories?
- How to update post meta on uploaded image from a custom form?
- How to retrieve category of a post in have_post loop?
- Disable custom taxonomy on admin bar
- Assign CPT archive page attributes
- Want a custom query with just one category but from all custom post types
- Filter content in shortcode
- Custom post type and custom taxonomy 404 on page 2
- How to constrain the results to a specific post_type on tag archive page?
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Front end create custom post types
- set object terms after some some time of published post – functions.php
- Custom Post type page content (archive page)
- Dynamic page for nav items used as filters
- Set up Custom Taxonomy Archive Template File To Cover 3 Categories
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- ACF field check value of field on all other articles
- How to use POST method using custom wordpress button?
- Do not load the categories in Category.php
- How to sort custom post’s category by id from the theme’s function.php?
- Remove slug from Custom Category Permalink + dual-category permalinks
- WordPress Set A Static Page/Template For All Sub-Pages
- Add HTML before a specific div?
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Issue displaying multiple TinyMCE editors with WPAlchemy