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
- Separate archive template to show posts and CPT by same category/taxonomy
- WordPress Custom Post Type Archive, filter by category and get pagination working
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- I am having a problem with form updating/editing WordPress post on the frontend
- How to filter out post type meta?
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- CPT posts listed by category with custom rewrite URL, please help!
- Custom post type archive page pagination
- Custom Post Types and archives
- Custom Post Type Events Archive Grouped By Month
- Display Next/Prev when looping Custom post-types archive?
- Search doesn’t find tags or categories in custom post types
- Display custom field of specific post where post title matches variable
- Conditional to modify query results
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Need post_type_archive_title function but in ‘single’
- Display custom post type taxonomies as an archive page
- Custom Post Types and Categories?
- Display CPT description on archive.php pages for all CPT
- Output custom post shortcode. Help spot the error.
- Change name of custom post type archive
- How to count custom post types with conditional operators
- When ‘is_post_type_archive()’ return true?
- Editable content on a Custom Archive page
- Set a default category – if the user didn’t select one- before creating a post
- Get categories and descriptions from custom post type
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Combining custom post type and post category
- Second Custom Post Type Archive
- How to get “custom post type”-archive with working permalink to it?
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Link users to a custom post type
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Multiple custom post type loops in category.php
- Loading all files within a directory
- Querying Term Posts in Loop
- Blog page showing same content as homepage
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to create new category for custom post type?
- Using several custom fields as custom post title