Jump to content


Photo
- - - - -

More hooks issues..


  • Please log in to reply
2 replies to this topic

#1 joe_steer

joe_steer

    Advanced Member

  • Members
  • 58 posts
  • Country: Country Flag

Posted 02 March 2012 - 12:24 AM

Hi Guys, Does anyone know of a reason why I wouldn't be able to use both the hooks 'brandnav_after_brand' and 'brandnav_after_nav' at the same time? I'm trying to add both some text and some icons to my header section. Either of the hooks work on their own, but only the first will work if they are both there.. here's my code in functions.php:

Please Login or Register to see this Hidden Content

My test site is:

Please Login or Register to see this Hidden Content

Any help much appreciated! Many thanks, Joe.

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 02 March 2012 - 03:32 AM

By default, you can't use the same hook twice. If you want to use a hook to add your elements (whether it'd be links or images or text) to a certain portion of the page, you can add the content to that one hook instead of using two or more of the same hook to add your content. In your code, move the code for social icon links below the DIV layer code for the text in the hook at the top so that it looks like this (and then eliminate the second hook since it'll be useless/empty):

Please Login or Register to see this Hidden Content



#3 joe_steer

joe_steer

    Advanced Member

  • Members
  • 58 posts
  • Country: Country Flag

Posted 02 March 2012 - 10:53 AM

Of course! thanks Catrina.