WP Favorite Posts
Custom post type (21 posts)

  1. maxj
    Posted 2 years ago #

    Hi, I'm using custom post type to create my posts and the plugin dosn't work. I can see add to favorites button on the post page; I can klick to add it and I get a message that the post is my favorite one but when I go to the page that should show the favorites post list there is nothing to show. I was trying with a regular post and everything is working. How do I do if I want be able safe my custom post as favorites?


  2. lifesgood
    Posted 2 years ago #

    Maxj, this, unfortunately, won't help you, but I am experiencing the same problem.

    However... it definitely used to work on Custom Post Types... I built a whole directory around the idea of users being able to "favorite" directory listings for later reading. So I really need to get it working again!

  3. maxj
    Posted 2 years ago #

    Lifesgod, I found a different solution: http://codecanyon.net/item/user-bookmarks-for-wordpress/544129
    It is almost perfect but You can not use it if users are not logged in. I hope It can help You.

  4. lifesgood
    Posted 2 years ago #

    Thanks so much Maxj - I'll check it out. Curious... I've just discovered the plugin no longer also works on pages. Does that happen for you also?

  5. lifesgood
    Posted 2 years ago #

    I have rolled back to 1.5.6 and it works again...

  6. thatwastaxing
    Posted 2 years ago #

    Thanks lifesgood!

  7. aronjeney
    Posted 2 years ago #

    Is this really the only way for custom post types to work? Is there any difference in the code somewhere?

  8. alexsean
    Posted 2 years ago #

    I made it work with my custom post type by going into wpfp-page-template.php and replacing

    query_posts(array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page));
    while ( have_posts() ) : the_post();
       echo "<li><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> ";
       echo "</li>";


    foreach ($favorite_post_ids as $post_id) {
        $p = get_post($post_id);
        echo "<li>";
        echo "<a href='".get_permalink($post_id)."' title='". $p->post_title ."'>" . $p->post_title . "</a> ";
        echo "</li>";

    Hope that helps someone.

  9. maxj
    Posted 2 years ago #

    alexsean I own You!

  10. Tech4Eleven
    Posted 2 years ago #

    Alexsean, this fixed it for me too! I'm using a custom post type and I could click to favorite but it would never add it to my list page. I could even favorite a post on the post single page and it wouldnt list it. your code fixd both my issues!!!!

    thank you so much.

  11. lifesgood
    Posted 2 years ago #

    Thanks Alex - this worked for me too!

  12. Tech4Eleven
    Posted 2 years ago #

    @alexsean, are you using v1.5.8 with this code? I'm using v1.5.6 with this code and it works but wondering if I can upgrade the latest version. Do your posts clear out of the favorites page when clicked? Mine dont- i have to manually refresh the page to get them to clear out.

  13. alexsean
    Posted 2 years ago #

    We have v 1.5.8 installed. Clicking the remove song or the clear list links clears the songs and refreshes without the songs displayed.

  14. Tech4Eleven
    Posted 2 years ago #

    ok thanks. my page template's ajax still doesnt work even with 1.5.8 but i'll keep looking.

  15. websta
    Posted 2 years ago #

    alexsean, your fix worked perfectly on custom post types.

    <Does the "88 miles per hour" dance>

    Thank you!

  16. Flick
    Posted 2 years ago #

    I just wrote my own page template which seems to work well, so through I'd share... You can use the function to get the favourite ids out and write your own loop query...

    if ( function_exists('wpfp_get_users_favorites') ) $fp_ids = wpfp_get_users_favorites(); to get the IDs and writing your own query...

    Here's an example:

    if ( function_exists('wpfp_get_users_favorites') ) $fp_ids = wpfp_get_users_favorites();
    query_posts(array('post_type' => 'your-post-type', 'post__in' => $fp_ids, 'orderby' => 'post__in'));
    if ( have_posts() ) :
    	while ( have_posts() ) : the_post(); ?>
    	<div class="post-item"><a href="<?php the_permalink(); ?>">
    	<?php the_post_thumbnail(); ?><?php the_title(); ?></a>
    	<?php wpfp_remove_favorite_link( get_the_ID() ); ?>
    <?php endwhile; // end of the loop.

    This way you can display the list of favourites anyway you like...

  17. triggeru571
    Posted 1 year ago #

    Hi Flick, great stuff. Could you please tell me, does your code above go into functions.php or does it go in one of the plugins files?

  18. Flick
    Posted 1 year ago #

    Hi triggeru571,

    I put this code into a Template file directly... I created a template file in my Theme for the favourties page. You could put the code in your functions file by putting the relevant code inside a few hooks though.

  19. christelle017
    Posted 1 year ago #

    It still dos not work for me even if I change the code as Alexsean explained :(
    Somebody has another solution ?

  20. Adam Taylor
    Posted 1 year ago #

    Thank you alexsean. The code replacement in wpfp-page-template.php worked perfectly for me. Been looking all day for a solution :)

  21. Ata JBZ
    Posted 1 year ago #

    Hi guys;

    the above code inside the wpfp-page-template.php outputs the favs of the current user, with post-type issues that you probably solved.

    I'm trying to query most favorited of custom type 'idea' on archive-ibest.php .

    here's the code of archive-ibest.php :

        $custom_query = new WP_Query(array(
            'post_type' => 'idea',
            'meta_key' => 'wpfp_favorites',
            'orderby' => 'meta_value',
    <?php if (have_posts()): ?>
    <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
    			<!-- Content Template -->
                                                    <?php include (TEMPLATEPATH . '/CONTENTS/idea.php'); ?>
    			<!-- Content Template -->
    						<?php endwhile; ?>
    						<?php wp_reset_postdata(); ?>
    						<?php endif; ?>

    just nothing appears as results.

    I would be grateful for any help. I've also created a thread for this but nothing yet. here it goes :


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Favorite Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.