Jump to content
davemoppert

Adding A Facebook Like Link After Page Title/logo Using Hooks

Recommended Posts

davemoppert    6
davemoppert

I am wondering if there is any way for me to get a facebook like button to show up AFTER the site title/logo in the header?  I am close -- was able to add one above the title/logo, but cannot get it to align to the right of it.  I accomplished this by adding a hook into the functions.php: 

 

add_action('pagelines_site_logo', 'fblike');
function fblike(){
?>
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50a1c3640c621b4b"></script>
<?php }

 

You can see the site here: http://updated-kid2kid.com/test/ (it is a subsite)

 

I tried to change the hook function to 'pagelines_after_site_logo' and 'after_pagelines_site_logo' without any luck.  Any idea what I can do to accomplish this the way I would like?

 

Share this post


Link to post
Share on other sites
davemoppert    6
davemoppert

This is what I want it to look like:

whatIwant.png

 

This is what it currently looks like: 

whatItis.png

Share this post


Link to post
Share on other sites
Rob    547
Rob

You know there's always the option of adding a div wrapped shortcode from http://demo.pagelines.me/tools/

 

Wrapping it in a div or class would allow you to position it where you'd like.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
davemoppert    6
davemoppert

I got it figured out. Turns out the div was forcing it to show up before the title.  I just put it in a span, added a class style to the span and it is working now.  

Share this post


Link to post
Share on other sites
davemoppert    6
davemoppert

Hey Robb - I would (I love the pagelines shortcodes) but the client needs it to work with analytics from her addthis.com account.  

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


  • 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.
×