Support » Plugin: WP Favorite Posts » [Plugin: WP Favorite Posts] Favorite list on profile page

Viewing 7 replies - 1 through 7 (of 7 total)
  • You’ll need to pull entries based on the user id – I’m working on a solution for this right now on a client site and will post back when I get it working. I’m planning to pass the user id through wpfp_get_users_favorites and go from there.

    Don’t add that to user-edit.php though, you need to make an author page template and add it there for people to see on the front-end.

    Hi ckhicks,

    Did you manage to find a solution to this problem?

    I’m interested in that too!

    me too!

    me too 🙂

    This query works for me…
    You would need to change the meta_value to the current users id

    <?php // Display user favourite courses
    			$args 		= array(
    					'post_type'		=> 'post',
    					'meta_key' 		=> 'wpfp_favorites',
    					'meta_value' 	=> $auth_id,
    					'numberposts' => 20,
    					'orderby' => 'meta_value',
    					'order' => 'DESC'
    			);
    
    			$the_query = new WP_Query( $args );
    			 if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    
        <h5><a href="<?php the_permalink(); ?>" title="Click to view <?php the_title(); ?>"><?php the_title(); ?></a></h5>
    
    <?php endwhile; else: ?>
    
        <p>No favourite courses just yet.</p>
    
    <?php endif; wp_reset_query();?>

    I’m confused…
    If I place the above code in the author.php page I get a list of favorite posts even if the user has not yet added any favorites.

    You write: “you would need to change the meta_value to the current users id”

    Can you clear this a little bit fo a non expert WP user like me?
    I simply want to show in the author.php his/her favorites that must be also seen by anyone visiting that page…
    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP Favorite Posts] Favorite list on profile page’ is closed to new replies.