WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
how to show count on avourite post like this (4 posts)

  1. Raja Ikram
    Member
    Posted 1 year ago #

    how to show count on avourite post like this
    my favourite (3)
    in widget

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. Eliasz Kubala
    Member
    Posted 11 months ago #

    Hi Raja Ikram

    I had the same problem.

    Try this code.

    $fav = 	$wpdb->get_var(
    "SELECT count(*)
    FROM wp_usermeta
    WHERE meta_key='wpfp_favorites' AND meta_value LIKE '%".get_the_ID()."%'"
    )  		;
    if($fav > 0){
    	echo '<div id="count">';
    //					echo '<a class="wpfp-link" rel="nofollow" href="'.site_url().'?wpfpaction=add&postid='.get_the_ID().'">';
    	echo '+'.$fav;
    	echo '</a>';
    	echo '</div>';
    }
  3. Waqas
    Member
    Posted 11 months ago #

    Eliasz Kubala,

    It shows only '1' if user has favorite posts and '0' if has not favorite posts. It don't generate total number of favorite posts.

  4. Waqas
    Member
    Posted 11 months ago #

    sorry, I had my statistics disabled from plugin settings, its working fine now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic