Edit header
-
Hello
Congratulations for your theme: it’s excellent.
I’d like to edit header only on my homepage. I created a child theme (style, functions, index, header) but index.php from longevity-child doesn’t work.
Thank you
Pinprenelle
-
Thank you 🙂
What were you trying to change in the index.php?
What I will do is try to replicate on my local test site what you were trying to do.I created a header-home.php and on my index.php I added:
if(is_home() ) get_header('home'); else : get_header(); endif;The code is correct how you do it, but just to confirm a couple things:
1. Did you put your custom header-home.php in the child theme?
2. did you replace get_header(); with your code above with the index.php in your child theme?I did a quick test on my local site and was able to use the custom header I created in the child theme.
Yes and yes.
I realized index.php didn’t work when I just added echo ‘hello’ and nothing appeared.It’s my first child theme maybe I did something wrong:
1) I created longevity-child folder
2) I copied/pasted ccs file from parent theme
3) I created functions.php<?php /** * Functions and definitions * @package Longevity */ // Lets begin by grabbing our stylesheet from the parent theme add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { // Load our main stylesheet wp_enqueue_style( 'longevity-child-parent-css', get_template_directory_uri() . '/style.css' ); } ?>4) I added header-home.php
5) I activated child theme throw back officeYour child theme functions looks right, but what does your stylesheet header info look like?
Here is an example:
/* Theme Name: Longevity Child Theme URI: http://www.shapedpixels.com/free-wordpress-themes/longevity Author: shapedpixels.com Author URI: http://www.shapedpixels.com Description: This is a blank child theme to use with the Longevity theme Template: longevity Version: 1.0.0 License: GNU General Public License v3 or later License URI: http://www.gnu.org/copyleft/gpl.html Text Domain: longevity-child Tags: responsive-layout, custom-colors, post-formats, custom-background, featured-images, microformats, theme-options, translation-ready */
Also to make sure…did you put a copy of the theme’s index.php into the child theme in the same place where the child theme’s style.css is and the functions.php is. Same goes for your header-home.php file too.
…then last and to double check, your child theme folder is in the /wp-content/themes/ location?
My styleshhet header is exactly like yours.
All my files are in longevity-child folder which is in themes folder.
I just update parent theme, delete child theme and upload it throw back-office: index.php still doesn’t work… I’m desperate
This is going to sound like a crazy question, but is your child theme the active theme and not the parent theme?
How do I make my logo bigger…Its driving me cazy
I finally found the bug: it’s me!!!
I forgot specify my homepage as static page… I’m so sorry for time you spent…
The topic ‘Edit header’ is closed to new replies.
