In the line before <header id="header">
, put this code:
<?php if( is_home() ) : ?>
After the </header>
tag that closes #header (which isn’t included in your code), put this code:
<?php endif; ?>
The is_home()
is called a “template tag” and there are quite a few of them. If your site uses a static front page set on Settings > Reading, then replace is_home()
with is_front_page()
.
Related Posts:
- wp_redirect() – headers already sent
- Auto get_header and get_footer on every template?
- How can I get wp_head() as a string instead of echoing it?
- Template Hierarchy for get_header()
- How to remove header images from all pages except the home page? skeleton theme
- Add social icons in a theme through custom admin menu
- Fatal error: Call to undefined function get_header()
- How can a Theme Contain no Header File or Footer File?
- How do the default themes reference style.css?
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- How to remove header image in Twenty Eleven theme?
- How to create a fixed header and scrolling content area
- Dynamic menu links after header title
- Second menu has the first menu ID
- Changing footer depending on URL (poli language site)
- header, stylesheet not being read
- Why is the `if else` not working?
- How to add cropped custom header image?
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Change header image on a particular page
- Dynamic meta description
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- How to create full header but keep content narrow
- Custom single template for a specific category
- Get the first image from post content (eg.: hotlinked images)
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- wp_nav_menu sort order?
- Twenty Eleven home page show only excerpt
- Snippet: Use classes instead of inline styles for text alignment
- Make a custom theme translate-ready
- Grab the first paragraph of each post
- Wrapper class: How to get rid of call_user_func_array() warning?
- Change Genesis Tag from Page Template [closed]
- Set Expiration Date of a Post from the Frontend with wp_insert_post
- How to Handle CSS for Multiple Header header.php Files?
- Resources for a complete beginner to learn to work professionally with WordPress [closed]
- How to tell if the user is an admin?
- Adding WordPress colorpicker in widget settings
- What is wrong with this code I have to make a blockquote shortcode
- Removing title tags from each page
- How to attach different React Components to different Dom Roots using the new WP wordpress/scripts webpack/babel
- Remove Cookies From WordPress Core
- Is it necessary to prefix every css class in a theme framework?
- Warning/Error in Admin Panel while developing theme
- Where can I access my custom page template?
- How to display posts in hyperlink with nested slugs?
- How to add a download link to a movie from WP media library?
- Is it a bad practice to use switch_to_blog in the frontend?
- Arguments ignored/markup changed in wp_nav_menu if no menu is selected
- Theme name passed into some of the functions?
- WordPress custom post type permalink: website.com/post-name/post-id
- paged > max_num_pages won’t throw 404
- Custom post fields
- Execute upgrade-theme with coding
- Apply different Class for each element in a foreach()
- Fatal error in comments.php
- Getting custom posts by post id from cutomizer text input
- How do i define the location of a git push to WP Engine
- WP_Comment_Query – Get comments and answers separately
- Theme Javascript.php Overwritten Nightly [closed]
- Is there a way to visualize / print out which templates were used to render a given piece of UI?
- How to use widget in a widget-less WordPress theme?
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- In creating a theme, how can i allow a user to change an image outside post/page content?
- What Does “Cannot modify header information?” Mean
- Are there any caveats to compiling all of my theme’s SCSS into the style.css file in the theme root?
- SVG in list-style-image breaks when adding fill
- What template file is used for homepage pagination?
- WordPress theme resource won’t load over VPN
- Templates without a loop, best practice?
- Alignment Problem [closed]
- How the redirect_to parameter is added to wp_login.php when trying to access wp-admin?
- Multiple editable areas
- Converting a static HTML template into a WP theme – How do I specify page content?
- Unwanted empty line at the beginning of document
- Why is my container argument not working for wp_nav_menu() [closed]
- How to display date of blog creation
- Translate a theme with a PO file
- All pages are the same
- How can I get the featured image or the first image for a post/page and display it as a banner?
- How to Split loop in multiple column in archive page
- Auto focus RichText field
- My wordpress theme name isn’t updating straight away
- Warning: This page allows direct access to your site settings. You can break things here. Please be cautious!
- How to get next post and previous post URL in loop, single.php My WordPress 4.9.6
- Import settings from another theme
- Load multiple css simultaneously using functions.php
- bbPress: modifying template for forum index
- control posts order by select option
- Nav menus Fast previewing not working with wp_get_nav_menu_items!
- Load get_page_templates into select menu
- Let users to add any number of input fields in the theme option page
- how to make a new page affected by a theme’s index.php layout?
- Add custom field to existing meta box?
- Theme Options Doesn’t Work On WP Multisite
- WordPress two sidebar layout or theme
- add_action not working in header?
- Subsite theme mystery man replacement with Buddypress on main site [closed]
- Recent posts with comment count in “Sidebar” template [closed]
- HTML to WORDPRESS [closed]