WordPress.org

Ready to get started?Download WordPress

Forums

WP Favorite Posts
Favorite list on profile page (8 posts)

  1. borisj
    Member
    Posted 1 year ago #

    Hi,

    is it possible to add the Favorite list to the user's profile pages?

    user-edit.php

    To do this I guess I have to modify and add the code of the

    wpfp-page-template.php

    Would be great!
    Boris

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

  2. CK Hicks
    Member
    Posted 1 year ago #

    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.

  3. talha8877
    Member
    Posted 1 year ago #

    Hi ckhicks,

    Did you manage to find a solution to this problem?

  4. atez1231
    Member
    Posted 1 year ago #

    I'm interested in that too!

  5. Leon Harris
    Member
    Posted 1 year ago #

    me too!

  6. mafaldam
    Member
    Posted 1 year ago #

    me too :)

  7. pressingprojects
    Member
    Posted 1 year ago #

    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();?>
  8. andrea82
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic