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?
- WordPress “Blog” template hierarchy
- 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?
- How to remove wp_link_pages() from template
- How can I get WP to use templates in lower-level subfolder?
- Generate Catalog Of Posts Based On Template
- Extending body classes in front- and backend
- Is there a way to set different post templates for parent posts and child posts in the same post type?
- Having trouble with Template hierarchy. I Need to create a set of pages that drill down from states to specific locations
- How to identify which template WordPress’s default search-form retrieves in my theme
- How to change header image size in custom themes
- Different Template based on HTTP Referer
- Where is Number of Posts Set?
- How can I force URL of a custom post type archive to use a page template?
- Possible to have one template call different sidebars for different pages?
- How does WordPress choose archive type template?
- Does wordpress templates always in files or in database?
- How to properly Remove certain CSS / JS files from template
- What is the most efficient way to create multiple versions of the same template?
- Are there any downsides to not using get_header(), get_sidebar and get_footer()?
- How do I get the page template name chosen?
- How can I add text to a specific ‘Edit Page’?
- Automatically use specific template to load subpages
- how can I add a “read more” tag directly in the template?
- Update template without undoing all my edits?
- How to get and set the post tag value within WP Query from URL?
- How to display specific child page template in wordpress
- The wordpress website is showing ‘w’ while it loads and in the footer
- how to properly include or get file contents in a wordpress theme
- Is there a wordpress template like this [closed]
- Assign Specific Template for Custom Post slug
- Why won’t the action hook wp_head accept parameters?
- the_post() in RSS feed
- How Add Code in Page Index Custom Template?
- Editing my loop-page.php causes posts to show on all pages
- How can i conditionally load taxonomy-{taxonomy}.php template php files through functions.php
- Commented code in WordPress template?
- Search button click sends to single-custom_post_type instead staying at the same page
- WordPress site not loading styles on desktop?
- Display all page which have not a certain template
- ACF – Attach JS file depending on ACF field
- Which template(s) to override to use a different sidebar for blog, single posts, categories, blog archive?
- how to insert gravity newsletter subscription form in template
- how to change custom post type search template to output search results in posttype-archive.php
- How can I modify this code to include the parent?
- Locating the template behind a WordPress Page
- why get_header doesn’t work twice in a test
- Is this the best way to complete disable category archive pages?
- query_post while (have post) get_template_part()?
- Search results in custom template
- Is there a list of all possible WordPress URL’s?
- How can I setup custom templates for a meta-data query
- Move Index to a page
- Problem with custom page template and permalink
- Index template and Home page
- Taxonomy template for all taxonomies attached to certain post type
- How to display page content and a list of posts on the same page?
- Force template on page load
- Make a PHP file with a function
- Post archive is not using the assigned template
- Category theme template becomes default template for child theme
- Template adding to the page
- Adding new Template Parts in the Block Editor when using Classic Themes