WPIntell

Source evidence

header.php Won’t Open

WP Header Images · support · 2021-02-06T15:41:00+00:00

mixedsentiment
mediumseverity
0.85relevance
25replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 21 rows with source links

23.8% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

16 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
kgg97 resolved
I 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.

Comments

25 shown
ibulbworksupport 2021-02-06T15:51:00+00:00

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 .

kgg97 2021-02-06T16:05:00+00:00

How would I go about copying and pasting header.php from parent theme to child theme?

joelparker 2021-02-06T16:19:00+00:00

@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

kgg97 2021-02-06T16:34:00+00:00

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

Fahad Mahmood 2021-02-06T17:31:00+00:00

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.

joelparker 2021-02-06T18:18:00+00:00

@kgg97 Please see the below given screenshot I hope it will help you to add snippet from admin dashboard. https://paste.pics/BIV52 Thanks

kgg97 2021-02-07T16:43:00+00:00

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.

joelparker 2021-02-07T17:13:00+00:00

@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

joelparker 2021-02-07T17:19:00+00:00

@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 .

kgg97 2021-02-07T18:04:00+00:00

@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.

joelparker 2021-02-07T18:12:00+00:00

@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

kgg97 2021-02-08T19:11:00+00:00

@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

kgg97 2021-02-10T18:05:00+00:00

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!

joelparker 2021-02-11T03:46:00+00:00

@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 .

Fahad Mahmood 2021-02-11T04:37:00+00:00

@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]'); } ?>

kgg97 2021-02-15T20:00:00+00:00

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

Fahad Mahmood 2021-02-15T20:05:00+00:00

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.

kgg97 2021-02-15T22:54:00+00:00

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.

Fahad Mahmood 2021-02-15T23:23:00+00:00

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.

kgg97 2021-02-20T23:45:00+00:00

@fahadmahmood I’m not sure what you mean by setting a default image and another image or why I should do that.

Fahad Mahmood 2021-02-21T07:51:00+00:00

@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

kgg97 2021-02-22T00:45:00+00:00

@fahadmahmood Yes I have this default image option.

Fahad Mahmood 2021-03-02T19:37:00+00:00

@kgg97 default image should work for every page where you do not set the header image.

kgg97 2021-03-03T22:32:00+00:00

@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.

Fahad Mahmood 2021-03-05T16:31:00+00:00

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.