Archived

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

  • 0

Looking for a hook

Question

Posted · Report post

Hi,

 

i want to put content right beside the logo in the fixed nav bar. Do we have a hook there and whats the name of it?

Share this post


Link to post
Share on other sites

13 answers to this question

Posted · Report post

There is no hook to place something inside the fixed navbar - just above or under the navbar hooks are available.

Share this post


Link to post
Share on other sites

Posted · Report post

Depending on the scope or volume of the content, you may use a menu-item in Dashboard > Appearance > Menus to add a non-linking Custom Link.

 

Just put # in place of the link, and a very small amount of text in the Label field.  I'd say under 45 characters. More than that and it probably should not be in the NavBar.

Share this post


Link to post
Share on other sites

Posted · Report post

If you are not using the search in the navbar you could use the hook get_search_form and replace the function.  Just a thought, not necessarily a solution.

 

Ellen

Share this post


Link to post
Share on other sites

Posted · Report post

@Ellen Thank you for the code, i will try it out an post a feedback :-)

 

@Rob Yes i did, there is a hook above the fixed navbar an after the fixed navbar - but no inside. For me it still looks like the get_search_form hook is the only one.

Share this post


Link to post
Share on other sites

Posted · Report post

Guido,

 

I'm not sure how long this description is, or what's in your menu, but if you are concerned with SEO issues, the menu really isn't a good place to add a tagline. The search engines would see it as a menu item, not as a tagline, so it will not be included properly in search results.

 

Try this:

If you have the ContentBox section installed and activated, go to Dashboard > PageLines > Drag & Drop and add the Content Box in the Header, directly under Branding.

Go then to Dashboard > PageLines > Page Options > Site Defaults > Content Box.  The first line lets you enter a unique term for a class.  Make sure this is a most unique word.  It may contain numbers, dashes ( - ) or underscores ( _ ) or letters, but no punctuation or spaces.  The next box down, you'll see an area where you may type your tagline. Save.

 

Next, view the site.  The content box with the tag line should be below the branding logo.  Using Firefox or Chrome's Inspection Tool, you can find the element which is the entire content box.  Move this using margins, to where you want it placed.  Then, using the unique class you created, style the text you added, changing the font color, font selection, size, etc.

 

This will be fully searchable by the bots, and you will have it placed exactly where you desire.

Share this post


Link to post
Share on other sites

Posted · Report post

Alternatively install the free actionmap plugin from the store, it highlights all available hooks on your page.

Share this post


Link to post
Share on other sites

Posted · Report post

This could be a good solution, thank you!

My post is regarding the blog description ( - "just another wordpress blog"), i think it should be possible to add it as text on the right side of the logo in the fixed nav bar. This could also be a suggestion for further developement of Pagelines. At the moment i wrote the blog description into the logo.png, which is of course not as good as real text.

 

To utilize the hook get_search_form form for that purpose, would it be possible to place the whole code in the functions.php? If yes, could somebody please provide the code?

Share this post


Link to post
Share on other sites

Posted · Report post

The simplest way to add your tagline, would be to add it to the logo image it self. You can use a free program called GIMP or Adobe Photoshop to edit your image.

Share this post


Link to post
Share on other sites

Posted · Report post

Thank you for contributing an excellent idea Ellen!

Share this post


Link to post
Share on other sites

Posted · Report post

 At the moment i wrote the blog description into the logo.png, which is of course not as good as real text

 

 

That´s exactly what i did - the idea was to add it with a hook, e.g. the get_search_form hook in case it is not used for the search form.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Guido,

 

Since I made the suggestion here is some help with the hook.  You'll have to do some css styling to get it to display in the position you want but this is a start.

 

add_filter('get_search_form','get_site_description');
function get_site_description() { 
?>
	
	<div class="my-site-description"><?php echo bloginfo('description'); ?></div>'  
  
  <?php }

 

The search form will still be there.  If you want to override the search form change add_filter to add_action.

 

Good luck!

 

Ellen

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Guido...

 

Have you tried using the Action Map plugin to identify the best hook?

Share this post


Link to post
Share on other sites