Conversation
supportI am trying to follow the instructions for inserting a header image. I copied the code snippet and am trying to insert it into header.php, but when I click on the link header.php it says the requested theme does not exist. I am not sure what that means or what I should do from here.
All themes do not have header.php . Maybe you are using a child theme and only parent theme has header.php . It is recommenced to copy header.php from parent theme and paste in child theme. You can add shortcode for header images in parent theme’s header.php . This reply was modified 5 years, 3 months ago by ibulbworksupport .
How would I go about copying and pasting header.php from parent theme to child theme?
@kgg97 All themes do not have headers.php file. So, You can try the code snippet in page.php or single.php it will also work in these files. Please let us know that, If this method works for you Thanks
Where would I find page.php to insert the code snippet? I’m not sure because there’s not a link for it like there is for headers.php. Sorry I don’t know much about WordPress. Thank you
Can you please check your admin panel and Appearance > Theme Editor? There you will see all the available files. You may share your screenshots so we can help you better.
@kgg97 Please see the below given screenshot I hope it will help you to add snippet from admin dashboard. https://paste.pics/BIV52 Thanks
Since my theme apparently doesn’t have a header.php I inserted the snippet into page.php. However this put the image on every page of my blog when I only wanted it on the home page. @joelparker I have the heaeder.php in the theme editor but I don’t want to directly edit the theme because I’ll lose my edits when the theme automatically updates.
@kgg97 Yes, It is not recommended to edit header.php directly in parent theme, you should use a child theme then you can easily edit any file of theme without losing any edit. For child theme you can use any child theme creator plugin or tell me your theme name may be I can suggest you any child theme of your current theme. Thanks
@kgg97 If you want to use header image only on home page, you can wrap snippet with home page or front page check. You can also use below given snippet, with this image will show only on home page. <?php if(is_home()){ do_shortcode('[WP_HEADER_IMAGES]'); } ?> This reply was modified 5 years, 3 months ago by joelparker .
@joelparker I am not sure if I’m using a child theme or a parent theme currently but my theme is Carbis. It’s ok to edit the theme directly if I’m using a child theme? I also inserted this snippet where I believe it is supposed to go on page.php but now I have no header at all.
@kgg97 Please check file style.css in theme editor if there is a template tag at the top of file then it’s shows that it is a child theme like showing in below given screenshot. You can also share the screenshot of style.css from the top of file. https://paste.pics/BJ5HF Thanks
@joelparker Ok so it looks like I have a parent theme because there’s no template tag? How would I make it a child theme instead? https://paste.pics/BJJ3M Also this is where I put that snippet and I got no header at all. https://paste.pics/BJJ4H
Thank you for your help everyone. I have created a child theme that I am using, so the problem I still have is that the header is on every page when I only want it on the home page. When I use this snippet: <?php if(is_home()){ do_shortcode(‘[WP_HEADER_IMAGES]’); } ?> @joelparker it gives me no header. Thanks!
@kgg97 Please try below given snippet and let my know if this snippet works for you. <?php if(is_home() || is_front_page()){ do_shortcode(‘[WP_HEADER_IMAGES]’); } ?> Thanks This reply was modified 5 years, 3 months ago by joelparker .
@joelparker please consider single quote as apostrophe or double quotes, because inverted commas will not work in PHP scripts. <?php if(is_home() || is_front_page()){ do_shortcode('[WP_HEADER_IMAGES]'); } ?>
I finally got it after trial and error of inserting the snippet into different spots and I have the header where I want it on only the home page. Now I just have to figure out how to insert a different header image on a different page. Thank you for your help @fahadmahmood @joelparker
You are welcome, we understand the inconvenience you faced but sometimes it is hard to explain the technical stuff related to files and code snippets as your website can experience downtime with a minor syntax error. We are glad that it worked.
Is it possible to now edit the header image once it is already on the home page? For example, I want to put text and a link on top of the header image, but when I go to edit the home page it shows there is nothing there. It just looks like this: https://paste.pics/BM0UU So I can’t edit the header image because it’s not showing up on the edit page.
On plugin settings page, you can set a default image and another image for homepage. Please try both, as you’re on homepage so these two should work for you.
@fahadmahmood I’m not sure what you mean by setting a default image and another image or why I should do that.
@kgg97 please check the following screenshot and let me know if you have this default image option on your settings page? https://prnt.sc/102le72
@fahadmahmood Yes I have this default image option.
@kgg97 default image should work for every page where you do not set the header image.
@fahadmahmood Okay so I have the header images set for the different menu items where I want a header but the ones other than the main menu are not showing up. https://paste.pics/BROHH But the more important issue is how would I go about adding text and a link to the header image.
Adding text and alignment feature is available in next tabs, please check styles etc. I don’t think if linking feature is available. And about header images for different menus, they should also work if menus are appearing somewhere on your page like footer or in sidebars. Maybe I didn’t understand your question. Menu should be somewhere so header images can find its relation with the menu item.
All themes do not have header.php . Maybe you are using a child theme and only parent theme has header.php . It is recommenced to copy header.php from parent theme and paste in child theme. You can add shortcode for header images in parent theme’s header.php . This reply was modified 5 years, 3 months ago by ibulbworksupport .
How would I go about copying and pasting header.php from parent theme to child theme?
@kgg97 All themes do not have headers.php file. So, You can try the code snippet in page.php or single.php it will also work in these files. Please let us know that, If this method works for you Thanks
Where would I find page.php to insert the code snippet? I’m not sure because there’s not a link for it like there is for headers.php. Sorry I don’t know much about WordPress. Thank you
Can you please check your admin panel and Appearance > Theme Editor? There you will see all the available files. You may share your screenshots so we can help you better.
@kgg97 Please see the below given screenshot I hope it will help you to add snippet from admin dashboard. https://paste.pics/BIV52 Thanks
Since my theme apparently doesn’t have a header.php I inserted the snippet into page.php. However this put the image on every page of my blog when I only wanted it on the home page. @joelparker I have the heaeder.php in the theme editor but I don’t want to directly edit the theme because I’ll lose my edits when the theme automatically updates.
@kgg97 Yes, It is not recommended to edit header.php directly in parent theme, you should use a child theme then you can easily edit any file of theme without losing any edit. For child theme you can use any child theme creator plugin or tell me your theme name may be I can suggest you any child theme of your current theme. Thanks
@kgg97 If you want to use header image only on home page, you can wrap snippet with home page or front page check. You can also use below given snippet, with this image will show only on home page. <?php if(is_home()){ do_shortcode('[WP_HEADER_IMAGES]'); } ?> This reply was modified 5 years, 3 months ago by joelparker .
@joelparker I am not sure if I’m using a child theme or a parent theme currently but my theme is Carbis. It’s ok to edit the theme directly if I’m using a child theme? I also inserted this snippet where I believe it is supposed to go on page.php but now I have no header at all.
@kgg97 Please check file style.css in theme editor if there is a template tag at the top of file then it’s shows that it is a child theme like showing in below given screenshot. You can also share the screenshot of style.css from the top of file. https://paste.pics/BJ5HF Thanks
@joelparker Ok so it looks like I have a parent theme because there’s no template tag? How would I make it a child theme instead? https://paste.pics/BJJ3M Also this is where I put that snippet and I got no header at all. https://paste.pics/BJJ4H
Thank you for your help everyone. I have created a child theme that I am using, so the problem I still have is that the header is on every page when I only want it on the home page. When I use this snippet: <?php if(is_home()){ do_shortcode(‘[WP_HEADER_IMAGES]’); } ?> @joelparker it gives me no header. Thanks!
@kgg97 Please try below given snippet and let my know if this snippet works for you. <?php if(is_home() || is_front_page()){ do_shortcode(‘[WP_HEADER_IMAGES]’); } ?> Thanks This reply was modified 5 years, 3 months ago by joelparker .
@joelparker please consider single quote as apostrophe or double quotes, because inverted commas will not work in PHP scripts. <?php if(is_home() || is_front_page()){ do_shortcode('[WP_HEADER_IMAGES]'); } ?>
I finally got it after trial and error of inserting the snippet into different spots and I have the header where I want it on only the home page. Now I just have to figure out how to insert a different header image on a different page. Thank you for your help @fahadmahmood @joelparker
You are welcome, we understand the inconvenience you faced but sometimes it is hard to explain the technical stuff related to files and code snippets as your website can experience downtime with a minor syntax error. We are glad that it worked.
Is it possible to now edit the header image once it is already on the home page? For example, I want to put text and a link on top of the header image, but when I go to edit the home page it shows there is nothing there. It just looks like this: https://paste.pics/BM0UU So I can’t edit the header image because it’s not showing up on the edit page.
On plugin settings page, you can set a default image and another image for homepage. Please try both, as you’re on homepage so these two should work for you.
@fahadmahmood I’m not sure what you mean by setting a default image and another image or why I should do that.
@kgg97 please check the following screenshot and let me know if you have this default image option on your settings page? https://prnt.sc/102le72
@fahadmahmood Yes I have this default image option.
@kgg97 default image should work for every page where you do not set the header image.
@fahadmahmood Okay so I have the header images set for the different menu items where I want a header but the ones other than the main menu are not showing up. https://paste.pics/BROHH But the more important issue is how would I go about adding text and a link to the header image.
Adding text and alignment feature is available in next tabs, please check styles etc. I don’t think if linking feature is available. And about header images for different menus, they should also work if menus are appearing somewhere on your page like footer or in sidebars. Maybe I didn’t understand your question. Menu should be somewhere so header images can find its relation with the menu item.