How to display a Hero section on post page

Support Area Forums Kerygma How to display a Hero section on post page

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
URL to the page in question: http://mongta.cn/?p=110
  • Author
    Posts
  • #26526
    will chen
    Participant

    Dear Bill,

    I’ve followed all the instructions in this topic:

    including replaced the whole hero-option.php according to this version: https://gist.github.com/billrobbins/81c3586a6b0da66529a9#file-hero-options-php

    And successfully added Hero for all categories in my site.

    But I cannot add Hero for a single post.

    How can I do it?

    Thank you!

    Will

    #26531
    Bill Robbins
    Moderator

    Hello Will,

    I think we can do that as well. Give this a try:

    Let me know if you run into any trouble there.

    Take care,
    Bill

    #26536
    will chen
    Participant

    Sorry Bill, I don’t think it’s working. Any other ways?

    #26538
    Bill Robbins
    Moderator

    Hey Will, are you looking to add the same hero image to all the posts? If so do you want it to be the same one as the main blog page or different?

    #26539
    will chen
    Participant

    Bill, I would like to know both the two ways, will it be possible?

    #26547
    Bill Robbins
    Moderator

    Hey Will,

    The code from earlier will add in the ability to have individual post hero areas. I just realized you don’t have the input for those options turned on in posts. If you’d like to do that, you’ll need to do a bit of editing. You’ll have to install a plugin called WP Editor in order to reach the file (or edit it off line and upload it via FTP). Either way, the file you want to edit in the theme is at /includes/custom-meta-boxes/kerygma.php. Find line 9 which should look like this:

    
    'pages'      => array( 'page', ), // Post type
    

    and change it to this:


    (copy that from the support site and not the notification email).

    That should turn on the box with all the hero options for your post.

    If you want them to be the same, go with this instead:

    That will use the hero options for the blog that are in the theme options on both the blog archive and individual blog posts.

    Let me know if you run into trouble,
    Bill

    #26553
    will chen
    Participant

    Dear Bill,

    I’m really thankful for your help, but here comes my trouble:

    1, I’ve tried to edit /includes/custom-meta-boxes/kerygma.php, and successfully turned on the Hero option for all the posts, and set a featured image for each post. But it doesn’t work, no hero displayed.

    2, then I turned to the second solution, I’ve replaced the hero-options.php and it worked well on all the posts, but every category lost its hero.

    I think I’ll work with the second solution, which will assign a same hero for all posts, while remaining hero for all categories. Could you please make a new hero-options.php file fot that?

    Thank you sooooo much!

    Will

    #26564
    Bill Robbins
    Moderator

    Hello Will,

    You’re welcome to give this one a try. It’s not tested:

    Take care,
    Bill

    #26587
    will chen
    Participant

    Thank you Bill for your hard work!

    It works perfectly now! 🙂

    #26589
    Bill Robbins
    Moderator

    That’s great news Will 🙂

    Let me know if you need anything else,
    Bill

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to display a Hero section on post page’ is closed to new replies.