Saturday, April 29, 2023

Like button! 🙂👍

Thumb up button goodness! 🙂👍

I used a free version of likebtn.com to add thumb up buttons to this blog. There's also a way to do this with Facebook Developer code, but I decided to try LikeBtn first. 

I also had to fiddle with the Blogger HTML code to get the buttons where I wanted it. The LikeBtn site does have easy to follow instructions for adding them to your blog, but it puts the buttons as a widget/gadget. You can move it around some, but I wanted the buttons to appear just below the post content and also not duplicated on the homepage. 

The issues with the buttons being on the homepage is because the button uses the name of the page to make it unique. So since all the blog posts are shown on the homepage, clicking one of the like buttons on the homepage will thumb them all up. That would also make the homepage buttons show different counts than the posts themselves. 

So I wanted the like buttons to only appear after clicking a post.

To implement this: 

  1. Go to https://likebtn.com
  2. Click Plugins from the top menu > choose Blogger
  3. Click the Add To Blogger button
  4. It should scroll you down to the middle of the page to an Installation section. Click Authenticate 
  5. After logging in to Blogger (or if you were already logged into Blogger, it should have opened a tab with your Blogger dashboard), switch back to the Installation browser tab
  6. Click Generate the code
  7. Pick your options from the left pane
  8. Then copy the code from the panel on the right

    If you don't want to mess with editing your blog's HTML, you can do steps 9-11 and stop. If you want to have the like buttons like this blog, skip to step 12:

  9. Switch back to the Installation browser tab and click Add to "Add Like button to Blogger"
  10. Make sure to choose the blog you want to add it to from the drop-down  
  11. After doing this, it will add the code as a widget/gadget that can be found in the Blogger dashboard under Layout

  12. In your Blogger dashboard, click Theme > Edit HTML
  13. While in the editor, click anywhere in the code and press Ctrl-F to search (the search box is small and will appear at the top left of the editor window). Type post-footer-line-3 and press Enter to jump to that section.
  14. Starting just after the </b:if> line, paste the red and blue code snippets like it is below. The red code tells the browser to not display this code on the homepage, and the blue code is your LikeBtn code. The <br/> line breaks are optional; you can include them if you'd like more space around the like buttons like me or omit them for tighter formatting: 

      <div class='post-footer-line post-footer-line-3'>
      <span class='post-location'>
        <b:if cond='data:top.showLocation and data:post.location'>
          <data:postLocationLabel/>
          <a expr:href='data:post.location.mapsUrl' target='_blank'><data:post.location.name/></a>
        </b:if>

      <b:if cond='data:blog.url != data:blog.homepageUrl'> 
      <br/>

      <!-- LikeBtn.com BEGIN -->
    <span class='likebtn-wrapper'/>
    <script>(function(d,e,s){if(d.getElementById(&quot;likebtn_wjs&quot;))return;a=d.createElement(e);m=d.getElementsByTagName(e)[0];a.async=1;a.id=&quot;likebtn_wjs&quot;;a.src=s;m.parentNode.insertBefore(a, m)})(document,&quot;script&quot;,&quot;//w.likebtn.com/js/w/widget.js&quot;);</script>
    <!-- LikeBtn.com END -->

     <br/>
    </b:if>

      </span>
        </div>
          <b:if cond='data:post.authorAboutMe'>
          

After the code is pasted, either click the eyeball icon at the top right to preview your changes in a new browser tab or click the Save icon at the top right to save your updates then open a new tab to view your blog to see if it looks correct.

Wednesday, November 10, 2021

Finally, a new post!

It's been almost 7 years since my last post on Dec 5, 2014, lol. A lot (and I mean a LOT) has gone on since then, but like Elton John said, I'm Still Standin'. 👍

Thursday, June 20, 2013