Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #870492

    Robert
    Participant

    Hi,
    How can I add a return link in the bottom right hand corner of every post? I would like the return link to bring the user back to the main blog page.

    Also, how can I add social sharing buttons at the bottom of every post?

    Thanks!

    #870859

    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #871664

    Robert
    Participant
    This reply has been marked as private.
    #872057

    Robert
    Participant
    This reply has been marked as private.
    #872414

    Rue Nel
    Moderator

    Hello Robert,

    Thanks for providing the url.

    To add a social sharing buttons and a return link in the bottom right hand corner of every post, please insert this following code in your child theme’s functions.php file.

    // Add share button at the bottom of every single posts
    // =============================================================================
    add_filter( 'the_content', 'add_share_button' );
    function add_share_button($content){
      if ( is_single() ) {
        $content .= do_shortcode('[share class="mtl" title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
      }
    
      // To add a return link to blog index
      $content .= '<div class="x-container return-link"><a class="x-btn x-btn-regular right" href="#">Blog Index  <i class="x-icon x-icon-arrow-right"></i></a></div>';
    
      return $content;
    }
    // =============================================================================

    http://prntscr.com/apkuts

    We would loved to know if this has work for you. Thank you.

    #874556

    Robert
    Participant

    Thanks for looking into this and providing a solution. The social media buttons are showing up great.

    I have 2 remaining issues that I would really appreciate your help resolving

    1) The Return button is showing up in the post but when I click on it, it brings me to the top of the post Not back to the main blog page.

    2) The post tags are still showing up below the posts on the main blog search page.

    Thanks!

    #874567

    Robert
    Participant

    #2 is resolved. I just need help resolving the 1) above. Thanks!

    #874987

    Rue Nel
    Moderator

    Great!
    Thanks for letting us know that this issue has been resolve.

    #875572

    Robert
    Participant

    #2 is resolved but #1 is not.

    The return button is showing up on post page but when you click on it, it brings you to the top of page. We want it to bring you back to the main blog page.

    Also, I just noticed the return button is showing up on all of the pages. It should only display on the post page.

    Can you please advise how we resolve these issues. Thanks!

    #876037

    Christopher
    Moderator

    Hi there,

    Please update your code in functions.php file to :

    / Add share button at the bottom of every single posts
    // =============================================================================
    add_filter( 'the_content', 'add_share_button' );
    function add_share_button($content){
      if ( is_single() ) {
        $content .= do_shortcode('[share class="mtl" title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
      }
    
      // To add a return link to blog index
      if ( is_singular("post") ) {
      $content .= '<div class="x-container return-link"><a class="x-btn x-btn-regular right" href="https://www.belmero.com/blog">Blog Index  <i class="x-icon x-icon-arrow-right"></i></a></div>';
    }
      return $content;
    }
    // =============================================================================

    Instead of https://www.belmero.com/blog add blog’s URL.

    Hope it helps

    #876719

    Robert
    Participant

    Thank you! That seemed to work with just a small tweak to the href url.

    We’ll continue testing and let you know if we run into any other issues. Thanks.!

    #876852

    Prasant Rai
    Moderator

    Feel free to ask us again. Have a great day! 🙂