How to put "HERO SECTION" on the top of blog region?
Support Area › Forums › Kerygma › How to put "HERO SECTION" on the top of blog region?
- This topic has 7 replies, 2 voices, and was last updated 9 years, 5 months ago by Bill Robbins.
-
AuthorPosts
-
October 23, 2014 at 02:34 #23445Liu Xiao-LingParticipant
Dear Bill,
I found that only page can have “HERO SECTION”, could you kindly advise how to make the “hero section” be shown on the top of blog area?
Or, how to put article lists on the page which have hero section?Thank you very much!
LolitaOctober 23, 2014 at 09:30 #23458Bill RobbinsModeratorGood Morning Lolita,
Excellent question there. On your posts page (your blog), WordPress ignores just about everything other than the page’s title. That’s unfortunate as it makes adding in a hero section not quite as simple. Here’s how you can get around that limitation and add a hero to your blog page:
- In your WordPress dashboard click on Media and then Add New.
- Upload the image that you’d like to use for your blog hero section. Once the upload is complete, click the edit link. On the right hand side of the screen that opens up you’ll see a field for the file URL. You’ll need that in just a moment.
- Next go to the Appearance section in your WordPress dashboard and choose Edit.
- From the list of files on your right, choose hero-options.php
- Find this line:
<?php if ( is_archive() || is_home() ) { ?>
and replace that with this:
(Be sure to copy that code directly from the support site and not the notification email.) - In line 7, replace the
http://yoursite.com/image.jpg
with the URL to your blog’s hero image that got earlier. - In line 14, change
Hero Title
to what you’d like to have your hero title be. You can delete the text if you’d rather not have a title. - In line 18, you can change the
Hero Caption
to the text for your caption. - In line 23, change the
http://yourlink.com
to where you’d like to have the button direct people and theButton Text
to anything you’d like to have your button say.If you’d rather, you can simply delete any of those you’re not going to use.
- Save your changes.
That should add in a hero section above your blog. If you have any questions, just let me know.
Thanks,
BillOctober 24, 2014 at 02:50 #23513Liu Xiao-LingParticipantDear Bill,
Good day! Thank you for your prompt reply.
I found the line” <?php if ( is_archive() || is_home() ) { ?>” wihch you mentioned and want me to revise the content, is not exist in the theme ” Kerygma “, but in the theme “ELITE”. Please find enclosed photos for your reference.Could you kindly check again and give me more instruction?
Regards with many thanks!
LolitaAttachments:
October 24, 2014 at 09:16 #23520Bill RobbinsModeratorLolita,
Yikes! I am so sorry about that. I must have had Elite on my mind yesterday morning. For Kerygma, you’ll still need to upload the file for your header as described above and go to the edit section. In the hero-options.php file, scroll to the very bottom and replace this line:
<?php } ?>
with this:
(Again copy the code directly from the support site).You can swap out the text as before to fit your needs. Then save your changes.
If you have questions or trouble, let me know.
Have a great weekend,
BillOctober 26, 2014 at 04:38 #23555Liu Xiao-LingParticipantDear Bill,
Thank you for your help, after tried, but it seems not work…:(
I guess that I might not explain my request clearly…I created “menu”on the home page by “article category”.
And I hope that I can set up “hero section” at every category page which have different image file.It’s possible to achieve?
Thanks a lot!
LolitaOctober 26, 2014 at 19:29 #23569Bill RobbinsModeratorLolita,
Sorry about that. Typically in WordPress when you speak of the blog, it’s in reference to the “posts” page that’s set in the reading settings, right below the home page. That page shows posts from all categories. The code above is for that page and not for a post category archive.
WordPress doesn’t actually have support for “featured images” for post categories built in. Fortunately, the theme already has something already built in to show images for series which work basically like categories do. With a bit of editing, we should be able to add that to post categories too.
- Back in the theme editor, edit the taxonomy-images.php file and replace everything in the file with this:
(Again copy that code directly from the support site and not the notification email.) - Save your changes.
- Edit the hero-options.php file again. This time, we’ll replace the entire file with this:
That has the code for our category images, plus the blog page code should you end up wanting a unified blog in the future.
- Save your changes.
Now when you edit a post category, you should see a field where you can upload an image that will be used as the hero image. The title of the hero section will be the name of the category. The description of the category will be the caption.
Hope that helps out. Have a great week,
BillOctober 27, 2014 at 09:11 #23583Liu Xiao-LingParticipantDear Bill,
Thank you very much! It works perfect now.
I really appreciate your great help, you’re amazing!
Regards with thanks,
LolitaOctober 27, 2014 at 09:24 #23584Bill RobbinsModeratorFantastic! I’m glad it’s alway squared away for you now.
Have a great week,
Bill -
AuthorPosts
- The topic ‘How to put "HERO SECTION" on the top of blog region?’ is closed to new replies.