WP Favorite Posts

  • Favorite list is empty.
FavoriteLoadingClear favorites

Your favorite posts saved to your browsers cookies. If you clear cookies also favorite posts will be deleted.

I made a plugin named as WP Favorite Posts. This plugin allows visitors to mark a post as favorite. There is no register requirement because this plugin saves data to cookies. Furthermore it can save data to database if user logged in. The user can see his/her favorite posts list from “Your Favorites” page which you created.

DEMO See it in action

Don’t forget to donate

[paypal-donation purpose=”WP Favorite Posts” reference=”nxsn.com”]

Installation

It’s very easy;

  1. Download the WP Favorite Posts plugin.
  2. Unzip into your /wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Place <?php if (function_exists('wpfp_link')) { wpfp_link(); } ?> in your single.php or index.php template file. Then favorite this post link will appear in all posts.
  5. Create a page e.g. “Your Favorites” and insert text into content section. This page will contain users favorite posts.
  6. That’s it :)

Widget

And there is a widget and template tag for listing most favorited posts. You can go widgets page for using widget. Template tag’s usage;

<h2>Most Favorited Posts</h2>
<?php wpfp_list_most_favorited(10); ?>

The parameter for limiting post count of list. Default value is 5 posts.

Bugs & Appreciations

You can report bugs or write your appreciations by using comments of this post. Also you can see the source code and the ChangeLog. Thanks for using my plugin!

New Feature Request or Need Modification

If you have a feature request or need modification which is urgent for you, contact me. We can make a deal.

Did you like plugin ?

If you like my plugin, i’ll appreciate it if you buy me a coffe or beer! I would love if you write a blog post/tweet etc about my plugin.
[paypal-donation purpose=”WP Favorite Posts” reference=”nxsn.com”]

Some Details

Show Link In Post Content

You can show Add/Remove Favorites Link into post wherever you want with writing FavoriteLoadingAdd to favorites into post content while HTML mode.

Change Template Of “Your Favorites” Page

(version 1.4) You can change “your favorites” page’s templates easily.

First copy wpfp-page-template.php from plugin’s directory to your theme’s directory. Then make template changes (add thumbnail image, make what you want).

If you make something wrong just delete or rename wpfp-page-template.php from your theme’s directory and page’s view will be turn back to basic view.

Who Uses This Plugin ? (DEMO)

http://www.nefisyemektarifleri.com/tarif-defterim/

http://www.hdvideoclip.com/my-playlist

http://www.android-software.fr/mes-favoris

http://www.beckermanphoto.com/your-favorite-prints

396 thoughts on “WP Favorite Posts

  1. Noura Yehia

    Hi Huseyin,
    First i would like to congratulate you on this nice plugin.

    I am having a problem here. I added the “Add to favorite” link on all the posts in he index.php of my theme folder. Now when i go to my homepage, and click on “Add to favorite” and after that i click on “Remove from favorites” i get “ERROR”.

    Do you have an idea why i am getting this.

    Thanks again for your time.

    Reply
  2. brian

    Hi. Can this be modified so that registered users can favorite comments instead of posts, and then see a list of their favorites? I would SO donate if that were the case! Thanks!

    Reply
  3. Pingback: WordPress Plugin Releases for 04/07 « Weblog Tools Collection

  4. mohamed

    I mean i have created a test blog
    i have added the blog entry to my favorite but it don’t appear in the Most Favorite Posts Widget
    i have opened phpmyadmin and all posts= zero fav
    do you know what is the problem ?

    Reply
  5. yili

    I love this great plugin. but I got a problem, when I enter my website from different PCs , I see all the same favorites record. any idea why this is happening?

    Reply
    1. Huseyin Berberoglu Post author

      @yiii if you are logged in on both of two pcs you will see same favorites. Are you logged in ? logout and try again.

      Reply
  6. Huseyin Berberoglu Post author

    @mohamed; go http:///wp-admin/options-general.php?page=wp-favorite-posts

    and check that Most favorited posts statics* option is enabled.

    Reply
  7. Noura Yehia

    I am not sure if you got my email but i upgraded to the latest verion and still getting this error.
    You can see this error on your demo page http://wpfptest.nxsn.com/
    If you add few posts to favorites and then go on to remove them one by one you will notice when you hover over the remove link that they all link to the same post which was http://wpfptest.nxsn.com/?wpfpaction=remove&postid=55

    Can you please have a quick look and let ,e know if you can find a fix for this.
    Thanks :)

    Reply
    1. Huseyin Berberoglu Post author

      @Noura Yehia, thanks for bug report. I fixed it and released a new version.

      Reply
  8. Noura Yehia

    Thanks Huseyin for your quick fix, would you mind telling me what exactly did you change cause i have modified the plugin a lot to fit my site’s requirements and didn’t update since version 1.4

    I know this might sound too much but it would really save us a lot of work here if you can just let me know what modifications you you did since version 1.4 including the bug you you just fixed now.

    Thanks again :)

    Reply
  9. Noura Yehia

    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

    Reply
  10. Noura Yehia

    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.

    Reply
  11. randy

    “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?

    Reply
    1. Huseyin Berberoglu Post author

      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 ?

      Reply
  12. Rosadi

    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

    Reply
  13. Huseyin Berberoglu Post author

    @Rosadi, read the -CHANGE TEMPLATE OF “YOUR FAVORITES” PAGE- section from this article.

    Reply
  14. niksos

    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!

    Reply
  15. ashley

    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

    Reply
  16. ashley

    Just deleted the plugin and reinstalled. All of my settings were still intact, but still nothing in the sidebar widget :(

    Reply
  17. Emily

    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!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *