I have a solution
$favorite_post_ids = wpfp_get_users_favorites();
//merge cookie favs for members
if (is_user_logged_in()){
$cookie_favorites = wpfp_get_cookie();
foreach ($cookie_favorites as $key => $cookie_favorite){
//echo $key;
if (!in_array($key, $favorite_post_ids)) {
//add favorite to db
wpfp_add_to_usermeta($key);
}
}
//refresh favorites
$favorite_post_ids = wpfp_get_users_favorites();
}
... display favorites
Where would this need to go in order to make it work? Please help?
I’m not sure where this is supposed to go please can you advise?
Hi,
Instead of using official shortcode to display favorites I created a custom template file which contains the code above. The $favorite_post_ids
contains the favorited posts IDs.
Try to put this code into a custom page template and after this code snippet you have two options:
-Probably the official wpfp_list_favorite_posts();
will also work,
-or you can create a custom loop to display favorites post from $favorite_post_ids
I hope it helps but you need some programming knowledge to solve this issue.