• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WordPress Tips, Code Snippets, and How To Tutorials

  • Home
  • Blog
  • Tips
  • Snippets
  • Tutorials
  • Contact

How to fix #comments div links for comments plugins in StudioPress Genesis

April 9, 2016 by admin 2 Comments

If you are using a WordPress Comments Plugin like Livefyre or Disqus to handle the comment discussion on your site, your theme’s links to the #comments div may be broken once the default comments have been turned off. Today’s snack will show you how to fix the #comments div links for comments plugins used in a StudioPress Genesis theme to where your theme’s Comment links work throughout your site.

Add this code below to the functions.php file of your current WordPress theme.

/**
 * Fix #Comments Div Links for Comments Plugins in StudioPress Genesis
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function fix_comments_links() {
?>
<div id="comments"></div>
<?php
}
add_action('genesis_after_post_content', 'fix_comments_links'); 

Now when a visitor clicks the Comments link for any of your posts, it will take them to the new comments area created by your WordPress Comments Plugin.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tips Tagged With: Comments, Functions.php, Plugins, StudioPress Genesis

Reader Interactions

Comments

  1. LeGrandEcart says

    April 28, 2012 at 12:11 am

    hello can you guide me to adapt this fix to the shakengrid template for wp ? http://www.legrandecart.net/debattre-en-toute-serenite/#comments
     
    is not poiting to the livefyre comment divs, but it does link well to the post..any quick fix ?

    Reply
  2. IliganLocal says

    May 25, 2012 at 1:29 pm

    Thanks for the tip! I’m using Disqus and it worked on my site. Still having trouble tho having custom elements appear before the “genesis_before_comments” hook. Might you have a solution to my problem?
     
    Thanks

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Hey, We Deliver... Anywhere!

Enter Email Address below to receive our snacks via email:

Join Over 1200 Readers!

Jump To A Random WordPress Tip

Copyright © 2019 • wpsnacks.com