Jump to content


Photo
- - - - -

Trying to add hook in brandnav but making nav disappear!

hooks brandnav

Best Answer James B , 23 May 2013 - 08:16 PM

Use the after nav hook in the branding instead, the one you're using now is just after the branding, it's before the nav is called. 

 

Use brandnav_after_nav

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 crogers

crogers

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 23 May 2013 - 06:19 PM

Hello,

 

I'm trying to add a tagline just above the nav in brandnav. But when I use the hook "brandnav_after_brand", my navigation within brandnav disappears completely.

 

Please Login or Register to see this Hidden Content

 

add_action('brandnav_after_brand', 'brandnav_tagline');
function brandnav_tagline() { ?>
<p>TEST</p>
<?php }

 

 



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 23 May 2013 - 06:51 PM

Hi, did you  close PHP before that code?

 

That could break it.



#3 crogers

crogers

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 23 May 2013 - 06:58 PM

Hi thanks for replying. Yes - I added those few lines to pagelines-customize/functions.php

 

I think I know what's happening though. The way it's coded in pagelines/brandnav/sections.php is below. Basically it says if you use this hook then it will ignore the brand nav. At least I think that's what it's saying with the if/else statement. Still not sure how to resolve it though!

Please Login or Register to see this Hidden Content



#4 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 23 May 2013 - 08:16 PM   Best Answer

Use the after nav hook in the branding instead, the one you're using now is just after the branding, it's before the nav is called. 

 

Use brandnav_after_nav



#5 crogers

crogers

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 23 May 2013 - 08:19 PM

Hi, Yes you are right, I actually just tried that - not the most elegant solution :) but I've used the hook brandnav_after_nav which displays with/underneath the nav and then positioned it above nav with css.

 

Please Login or Register to see this Hidden Content

 

Thanks!



#6 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 23 May 2013 - 08:31 PM

Site looks good :-)



#7 crogers

crogers

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 23 May 2013 - 08:33 PM

Thanks! Still a bit to do...