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
- How can I remove the “Add New” button in my custom post type?
- Exclude a category from WP_Query
- Custom Post Types on Category Pages
- Setting up custom post type archives in WP3.1? Any luck?
- How to list all categories and tags in a page?
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- How to let custom post type posts show in standard post archive (like in homepage)?
- Automatic category for a Custom Post Type
- Display Custom Category (taxonomy) Name in Custom Post Type
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Multiple custom post type loops in category.php
- just can’t get date-based archives per post-type to work
- Set menu active state for custom posttype and category, given custom taxonomy term
- how to check if custom post type column already exists?
- Can I list a custom post type within another custom post type in the admin area?
- How to display custom taxonomies with links in filter menu?
- Hide parent categories when clicked, and show it’s childs
- Custom archive page for CPT UI
- Multiple (two) category postings on the same page.
- Dynamically insert an article at the top of a taxonomy archive – or?
- Need help deciding on a taxonomy
- Get Posts by Category, Tag , and CPT Taxonomy
- Why does my URL keep returning 404 error code?
- cannot achieve this structure (custom posts VS categories VS ??)
- How to change Elementor Template for Single Page Post on Load
- Custom post type archive page filters
- Archive per year of a custom post getting the wrong post
- Alike Shortcode using in Custom Shortcode
- Custom query using one category that is used in all custom post types
- get taxonomies from terms
- To display the category of a specific custom post type
- Change Search display for Custom Post Type
- Custom post type categories giving 404
- tax_query not working?
- Get full control over custom post type url
- How to switch from custom post type URL to category URL?
- Using get_terms() as shortcode attribute
- category_name not working in WP_Query
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Getting ACF relationship field information
- Is it possible to make is_category() recursive?
- how to display custom taxonomies in front page
- Remove date rewrite rule for custom post type archive page
- How do I edit this code so that it also adds specific meta data into the user and subsequent CPT being created?