You can combine multiple conditional statements:
<?php
if ( function_exists( 'show_media_header' )
and ! is_home() // list of newest blog posts
and ! is_front_page() // front page, might be a static page
)
{
show_media_header();
}
?>
You don’t need a separate file for that.
Related Posts:
- Is there any way to use get_template_part() with folders?
- Is it possible to override the result of get_template_part()?
- Where is get_header(‘shop’) file in Woocommerce templates
- Get template part vs locate template function
- Templates & CSS – Proper Programming Practice?
- TwentyTen: Overloading template.php files vs. get_template_part
- Passing variables to template parts
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- How to move style from template file to section?
- Unable to include a template
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Valid HTML in Template Part
- How to duplicate a page template but make minor changes to the header?
- Return get_header and get_footer string instead of echo it
- Use a separate template for the home page only
- Not so common HTML transition to wordpress issue
- Page header on specific page is different from the rest [closed]
- Undefined get_header function
- How to create new template page and template-parts in wordpress theme [closed]
- Import a header template from another theme
- Including template pages within another template?
- Organize template parts and page templates in folders in regards of template hierarchy
- trouble calling different header.php for home.php
- How to get all template files used for rendering a single post/page?
- How can I pass a variable from a template to header.php of a theme
- get_template_part for template in subdirectory not working
- Display a custom 404 page without a redirect
- Set og:image programmatically in custom single post with external images
- How can I show contents of a template part inside of another page?
- Header and footer fail to load with SSL and custom links
- When to use content-pagename.php?
- Is it possible to call a template file inside wysiwyg editor? And how?
- How can i change email template for new user
- Enable page templates. How?
- Prevent comments_template() to load comments.php
- Page editor missing Templates drop down
- Custom templates folder
- How to Rename a Template File?
- get page templates
- How to assign a class to a page with a custom template?
- Proper Javascript Implementation
- Guest author’s post not display in author template
- Display different header images based on current page
- How to apply a custom template for posts by default?
- WordPress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]
- Is there a way to check which template file is being loaded, if it is not a page template file?
- How to remove wp_link_pages() from template
- How can I get WP to use templates in lower-level subfolder?
- how to make a home page for wordpress custom theme
- Generate Catalog Of Posts Based On Template
- Extending body classes in front- and backend
- How do I find the directory of a page template?
- Why write markup for index.php?
- How can I hardcode template selection?
- Changing layout programmatically
- How to identify which template WordPress’s default search-form retrieves in my theme
- How to use same page template if post status other than ‘publish’?
- How do I override the search template in a plugin?
- How do I make a variable available inside partials?
- Is there any way to write custom HTML is some .php file and then call it wherever necessary?
- How to redirect my custom template page to content-none.php if no posts found?
- Get URL of current post but not the page number
- Is template name always same as directory name?
- Single Post Breadcrumb not linking back to Custom Post Type Index?
- get_month_link uses what wordpress template?
- Load custom script on a single template
- No three-columns template in TwentyEleven?
- Can’t split the_title() by white space
- Differentiation between index.php and page.php
- Single-page.php template file name not shown
- WordPress custom template not showing in the list of available templates
- How to display custom post type?
- Pagination issue with tag.php
- How are the HTML classes generated?
- Page Template with Sidebar Naming Convention?
- Adding text to the footer of each post based on tags or categories
- Blog page won’t show Blog template
- How can I abstract code out of a template by using functions.php
- Make Permalink go to specific template
- WordPress function.php on ZendFramework CMS
- Site Title appearing twice on live site
- Give user option to select full post index page or excerpted index?
- how to change already posted blog to custom template wordpress?
- WordPress change title with custom dynamic
- Do not trigger page 404 on custom template
- Print different parts of content in template
- Page Template Selector Error
- Change Page Template Based on URL Rewrite in WordPress
- I want to display all related posts for a selected tag in WordPress
- WordPress Child Theme Template auth_redirect wrapper
- Show a custom template, no matter the page being viewed, if the user is not logged in
- printf, translation and the_author_posts_link()
- Tag Posts showing in wrong places
- wordpress header leaks into body in a specific template
- front page won’t change templates
- Including 2 Negative Is_Template Conditionals in header.php [closed]
- Add custom card template to masonry layout using Essential Grid [closed]
- Where is the general html template file?
- templates page not showing on gutenberg editor
- How to load php templates from html page (block theme)