Favorites display per user help
-
Hello im using wordpress 3.5.1 and buddypress, im using wp favorites for my user profiles i have created a favorite box in each user’s profile to display their favorite posts around the website, but i cant seem to display each user’s total favorite posts i set the following
but this seems to loop in each profile i mean for example in my profile it displays my fav posts fine but once i see the other user profile it shows my fav posts instead of his posts.
so i hope someone can help me out ..
<?php bp_displayed_user_id(); ?> <div class="profile-box items-following"> <h3><?php _e('fav posts', 'gp_lang'); ?></h3> <div class="profile-content"> <?php $favorite_post_ids = wpfp_get_users_favorites($user_id); if($favorite_post_ids) { ?> <?php foreach ($favorite_post_ids as $o) : $p = get_post($o); if ($p->post_status == 'publish') { ?> <div class="profile-item"> <!--Begin Image--> <?php if(has_post_thumbnail($o)) { ?> <div class="post-thumbnail"> <a href="<?php get_permalink($o); ?>" title="<?php echo $p->post_title; ?>"> <?php $image = bd_resize(get_post_thumbnail_id($o), '', 50, 0, true); ?> <img src="<?php echo $image[url]; ?>" width="<?php echo $image[width]; ?>" height="<?php echo $image[height]; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id($o), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id($o), '_wp_attachment_image_alt', true); } else { echo $p->post_title; } ?>" /> </a> </div> <?php } ?> <!--End Image--> <a href="<?php echo get_permalink($o); ?>" title="<?php echo $p->post_title; ?>"><?php echo $p->post_title; ?></a> </div> <?php } endforeach; ?> <?php } else { ?> <div class="profile-item"> <strong><?php _e('No posts have been added yet.', 'bd_lang'); ?></strong> </div> <?php } ?> </div> </div> <?php } ?>
- The topic ‘Favorites display per user help’ is closed to new replies.