Make Facebook comments count clickable (2 posts)

  1. borderline11
    Posted 3 years ago #

    I'm using a facebook plugin for comments, I managed to displayed the number of comments on the front page, with the bubble.
    Now what I cannot figure out how to do is to make the Coments word a link that will link to the permalink, like a normal comment count would do when using the WP comments
    I used this code on the loop

    <fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count> Comments

    the code on my theme's look about the comments is

    <?php if(comments_open( get_the_ID() ))  {
                                    ?>   <span class="meta_comments"><?php comments_popup_link( __( 'No comments', 'themater' ), __( '1 Comment', 'themater' ), __( '% Comments', 'themater' ) ); ?></span><?php

    what do I need to do to make it clickable ?

  2. bcworkz
    Posted 3 years ago #

    You're going to need to dissect the comments_popup_link() code to make your own function that echoes out just the URL portion of the popup link, including the comments_popup URL parameter and the onclick javascript event function call. Replace this function in place of the echo get_permalink() inside the FB tags.

    Before you spend too much time though, be sure the FB tag will accept a javascript event function call and it will still actually work. If not, you cannot have popup comments with FB counts.

Topic Closed

This topic has been closed to new replies.

About this Topic