WP Favorite Posts
Allows users to add favorite posts. This plugin use cookies and database for
saving data.
- If a user logged in then favorites data will saved in database instead of cookies.
- If user not logged in data will saved in cookies.
You can choose “only registered users can favorite a post” option, if you want.
Also there is a widget named “Most Favorited Posts”. And you can use this template
tag for listing most favorited posts;
Most Favorited Posts
If you use WP Super Cache you must add page (which you show favorites) URI to “Accepted Filenames &
Rejected URIs”.
Download
Latest version: Download WP Favorite Posts v1.5.6 [zip] (Downloaded 21443 times)
Donate
If you like this plugin show your appreciation and make a small donation.
Installation
- Unzip into your
/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress
- Place
<?php if (function_exists('wpfp_link')) { wpfp_link(); } ?>in your
single.php or page.php template file. Then favorite this post link will appear in all posts. - OR if you DO NOT want the favorite link to appear in every post/page, DO NOT
use the code above. Just type in [wpfp-link] into the selected post/page
content and it will embed the print link into that post/page only. - Create a page e.g. “Your Favorites” and insert
{{wp-favorite-posts}}
text into content section. This page will contain users favorite posts. - That’s it :)
Changelog
For changelog go here.
376 Comments
Hi,
Could you have a look at this image ->
http://img696.imageshack.us/img696/9656/tmpdf2c.png
The plugin sent a full page response, to an ajax request. This problem
seems to be with the plugin.
Let me know your thoughts about it and if there is a quick fix for it.
Thanks again
Noura; i checked dolody.com and i couldn’t see this problem.
Noura; you use last version of plugin, don’t you ?
Yes, i am using the latest version. The problem is that i am calling the posts in the bottom tabs through ajax, and the same posts in the bottom tabs are displayed in the top of the page.
So when i add a post through the tabs, it’s not added in the top of the page and same applies to deletion.
Also when i remove a post from the top and go to remove to remove it again from the bottom, i get a whole new page displayed beside the post title.
pls see image here:
http://img340.imageshack.us/img340/9191/26229317.jpg
I tested the page again and i couldn’t see this error.
I will tell you how to rpoduce this error step by step:
Please go to the main page and add “Hello world!” post to favorite. At the bottom you will see a tabbed box, click on the jquery tab and remove “Hello world!” from favorite, then go outside the tabbed box and remove “Hello world!” again from favorite, you will see a whole page displayed the post title.
I sent you an email, let me know what’s your thought.
Thanks
great idea ! we’re having a try here
http://fatratas.net/ma-liste-perso/
thanks a lot
“I’m having a problem with the plugin in php5. It says Fatal error: Cannot re-assign $this in /nfs/c01/h12/mnt/8786/domains/oxr.pulsecreativepartners.com/html/wp-content/plugins/wp-favorite-posts/wp-favorite-posts.php on line 133.”
Looks like I have this same issue. Was there a remedy found?
randy; i’m using plugin with php 5.2.12 and there is no problem. Which version of php are you use ? And which version you use of plugin ?
How to change template to show thumbnail images?
I used:
function retrieve_my_thumbnail() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘//i’, $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = “/images/default.jpg”;
}
return $first_img;
}
Thx
@Rosadi, read the -CHANGE TEMPLATE OF “YOUR FAVORITES” PAGE- section from this article.
I’m not interested listing the most favored posts in the sidebar, the only thing I’d like to do is to allow single user to save posts and display his or hers saved posts in sidebar widget? Is there a way to achieve this? Many many thanks!
Wrote a blog post about your wonderful plugin. I’m using it for users to save a list of the pictures they like.
http://www.beckermanphoto.com/blog/your-favorite-images-photography.html
You can see it in action in the store: http://www.beckermanphoto.com if you go to a picture. Feel free to list it as a demo if you want to.
Dave
Hi :)
I contacted you about the bug where users could rate their unpublished posts via preview, and you released a fix right away, which was awesome! I have another issue now, though…
I had some test posts up, which I had been favoriting and unfavoring, everything was working perfectly. I trashed those posts today to start putting up real posts in preparation for taking my site live, and when testing the favoriting feature on them (which works fine on the posts themselves) found that there’s no longer anything displaying in my “most favorited posts” widget. Not sure if you added a threshhold for how many times a post has to be favorited or not, but before this, even posts that had been favorited once would show up if the display limit for the widget was large enough.
I tried removing and replacing the widget as well as deactivating and reactivating the plugin, but no luck. I haven’t done an uninstall/reinstall yet because I didn’t want to lose my settings, but I can try that later tonight if that’s the only fix.
Really loving this plugin, though, and can’t wait to show you the site I’m using it on! Maybe I can be in your demo list :D
P.S. statistics ARE enabled ;)
Just deleted the plugin and reinstalled. All of my settings were still intact, but still nothing in the sidebar widget :(
This plugin is great, but I’d love to be able to add a thumbnail and I’m totally lost as to how to go about doing that.
I copied the template into my theme and I tried to use Rosandi’s code from above, but I don’t think I’m putting it in the right place? I can get it to load the default image, but it doesn’t seem to be able to find the thumbnail associated with the post. Guidance would be appreciated. Thanks!
Dave; Thank you. I’ve added your page as demo.
@ashley; I couldn’t reproduce it. Can you give me an explanation step-by-step ?
@Emily; Rosadi’s code pulls first image from post content. If you want to show post thumbnails on favorite posts list page you should use the_post_thumbnail() function.
For details about function; http://codex.wordpress.org/Template_Tags/the_post_thumbnail
Sure :)
I had a few test posts up, and the plugin and widget were working perfectly. Statistics were enabled, and the widget limit was set to 5. I only had 5 test posts and did not favorite them all, but what I had favorited was displaying in the widget.
I deleted all of my test posts, then put up 2 new posts. Marking/unmarking them as favorites works fine, but now nothing shows up in the widget, even when I have the posts marked as favorites. All I have is the widget title in the sidebar, and it’s blank underneath (until the next sidebar widget displays). Titles of the posts that have been favorited aren’t displaying any more.
If you email me, I’m happy to give you the site URL so that you can check it out. I just don’t want to make it public yet :)
On some servers widget desnt show any links
fast solution: in wp-favorite-posts.php find line
function wpfp_list_most_favorited($limit=5)
and change query to:
$query = “SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key=’”.WPFP_META_KEY.”‘ AND meta_value > 0 LIMIT 0, $limit”;
@Ivan Thanks. I think the CAST thing causes this problem. But your query doesn’t order the posts.
I’ll look for a solution of this problem.
@Ivan, i think we should use ROUND; http://www.phpbuilder.com/board/showthread.php?t=10350267
If ashley mail me the url I’ll test it.
@Huseyin Berberoglu, thanks for support!
Can u explain me: i want widget to show favorite posts of current user. is it possible?
@Huseyin Berberoglu,
I mean for unlogged users, just based on cookies information
It’s not possible with current version of my plugin. Maybe with next versions. If you need it immediately you can contact me for custom work.
@Huseyin Berberoglu ,
Thanks again for reply. I think it’s easy to do, just using your code:
in same file, function wpfp_widget_init() {
we need to change wpfp_list_most_favorited($limit); to
$favorite_post_ids = wpfp_get_users_favorites();
if (count($favorite_post_ids)) {
echo “”;
foreach ($favorite_post_ids as $o):
$p = get_post($o);
if ($p->post_status == ‘publish’) {
echo “”;
echo “post_title .”‘>” . $p->post_title . ““;
echo “”;
}
endforeach;
echo “”;
}
Just tried the solution that Ivan suggested, and my widget is now displaying “����”.
Not sure that I did it correctly, I literally just replaced “wpfp_list_most_favorited($limit);” with the code block mentioned.
About to undo the change, just thought I’d report on my results :)