Jump to content
Sign in to follow this  
crogers

Trying to add hook in brandnav but making nav disappear!

Recommended Posts

crogers    1
crogers

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
Rob    547
Rob

Hi, did you  close PHP before that code?

 

That could break it.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
crogers    1
crogers

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
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
crogers    1
crogers

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
James B    436
James B

Site looks good :-)


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • Dana
      By Dana+
      Hi DMS team,
      Please help out on how to add Post tags to the bottom of each post. Tried looking at the hooks tutorials but not sure what to do here.
      Thanks a lot.
       
       
       
       
    • jvheintze
      By jvheintze+
      I just tried to figure out how to use Lax in combination with Post Thumbnails the following way: instead of showing the Featured Image on top of the content section I would like to have a Lax section above the content which loads for each post the featured image. To do so it seems there should be some kind of word press hook support necessary (not ready yet)? Or did I miss something?
    • Justin Taylor
      By Justin Taylor
      I am using a child theme (the pl-starter-theme-master) and have added the following custom function to the child functions.php file:
      // Add AddThis share code to blog posts add_action('pagelines_loop_before_post_content', 'add_addthis_share_code'); function add_addthis_share_code() { echo"<div class=\"addthis_sharing_toolbox\"></div> "; } It isn't do anything. Can someone see why?
    • vanessabt
      By vanessabt+
      Hi, 
       
      I am starting to build a new site.  I would really like to use the MasterSlider plugin for my homepage slider.  I loaded it in and when I use it if I paste the generated shortcode into the page as instructed it ends up showing at the bottom of a content loop section instead of  at the top of the page.
       
      I realize that a hook probably needs to be added to tell pagelines to run masterslider,  but for the life of me I have no clue what needs to be put in or where it would go.
       
      I am building a demo site first before the site is moved so that I can troubleshoot issues like this.  I downloaded the base child theme since I figured we would need add the customization there to be safe from updates and for some reason the hooker section does not show up even though the plugin is installed so I cant use that either.
       
      I am also confused. do I use an action hook from pagelines or one from the masterslider site, http://masterslider.com/doc/wp/developer/#action-hooks.
       
      I tried to put both of these into the functions.php document
       
      <?php get_masterslider(1); ?> 
      <?php echo get_masterslider(1); ?>
       
      but all that seem to do was break the site.
       
      Does it need to be something like:
       
      add_action('pagelines_page', 'masterslider_homepage');
         function masterslider_homepage(1) {
         <?php masterslider(1); ?>
      }
       
      I am sure that is probably nothing but a hot looking mess, but I am at a complete loss of ideas with this.  And where does code like this go into the functions php document? I thought it would go at the very top but I sure I am wrong.
       
      Please let me know if you can provide any guidance.
       
      Thank you
       
    • rijans
      By rijans
      I have enabled Action Map in Pagelines Pro settings. But I don't see any map in my editor. Someone told it's plugin. But what's the link to the plugin.
×