Home Support Blog Way Overriding Hooks

This topic contains 5 replies, has 2 voices, and was last updated by  ProDesigns 1 year, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6684

    klpiazz@yahoo.com
    Participant

    Turns out that I’m not all that familiar with hooks. I’m trying to add a featured video widget in the ‘header.php’ file but everything is hooked. I think I’ve found the hook information in the ‘inc > hooks.php’ file, but I can’t seem to override it in my child theme. Is there a way to edit the hooks in a child theme? I hope that makes sense. Thanks for any feedback on this. I appreciate it.

    #6685

    ProDesigns
    Keymaster

    Hi klpiazz,

    Hooks are used to make theme customizable easily through child theme. You can override any section of this theme through hook.

    At header.php there are 5 hooks used. You can use appropriate hook to add featured video widget in header.

    For example, if you like it to appear after menu item and before site title/description section you can use blog_way_plus_after_header hook.

    If you like to add it on the banner/site title section you can use blog_way_plus_site_branding hook.

    If you like to add it before content section starts you can use blog_way_plus_before_content hook.

    There are 2 ways to customize through hooks.

    1. You can remove theme action and add your own action.

    2. You can copy function used by hook in functions.php of child theme and add/remove changes you need.

    Hope you can override theme now.

    #6686

    klpiazz@yahoo.com
    Participant

    Thanks, I really appreciate the feedback. I’ve been reading about hooks on several sites but I still have a hard time grasping the concept. Not sure how to implement it. Your #2 makes more sense to me than #1 so I’ll try that and see if I can figure it out. Is there a website that you suggest for learning more about hooks? A good tutorial maybe? Thanks!

    #6687

    ProDesigns
    Keymaster

    Hi klpiazz,

    This might be one of the best tutorial for hooks and filters in WordPress: https://codex.wordpress.org/Plugin_API

    Please let us know where do you want to implement video widget. We can provide you code so that you can learn from it and customize other sections if you need.

    You can use our online chat service for quick support.

    Thank you.

    #6688

    klpiazz@yahoo.com
    Participant

    Thanks for the great support. I appreciate the info and the offer but I’ve got it working now. I just need to spend more time learning some of this stuff. Too busy. Take care, and I’ll be sure to try and write a review in the near future 🙂

    #6689

    ProDesigns
    Keymaster

    Hi @klpiazz,

    Thank you and good luck.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.