Archived

This topic is now archived and is closed to further replies.

  • 0

Trying to add hook in brandnav but making nav disappear!


Question

Posted · Report post

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.

 

http://diskshred.it/

 

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

 

 

Share this post


Link to post
Share on other sites

6 answers to this question

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

Hi, did you  close PHP before that code?

 

That could break it.

Share this post


Link to post
Share on other sites

Posted · Report post

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!

/**
  44      * Section template.
  45      */
  46   	function section_template() {
  47  
  48              pagelines_main_logo( $this->id );
  49  
  50  
  51          if(has_action('brandnav_after_brand')){
  52              pagelines_register_hook( 'brandnav_after_brand', 'brandnav' ); // Hook
  53  
  54          } else {
  55  
  56          ?>
  57  
  58              <div class="brandnav-nav main_nav fix">
  59  <?php
  60                  wp_nav_menu( array('menu_class'  => 'main-nav tabbed-list'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'brandnav', 'fallback_cb'=>'pagelines_nav_fallback') );
  61  
  62  
  63                  pagelines_register_hook( 'brandnav_after_nav', 'brandnav' ); // Hook
  64  ?>
  65              </div>
  66          <div class="clear"></div>
  67  <?php     }
  68      }

Share this post


Link to post
Share on other sites

Posted · Report post

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.

 

http://diskshred.it/

 

Thanks!

Share this post


Link to post
Share on other sites

Posted · Report post

Site looks good :-)

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks! Still a bit to do...

Share this post


Link to post
Share on other sites