Title: Custom post type
Last modified: August 20, 2016

---

# Custom post type

 *  [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-type-24/)
 * 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?
 * [http://wordpress.org/extend/plugins/wp-favorite-posts/](http://wordpress.org/extend/plugins/wp-favorite-posts/)

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/custom-post-type-24/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/custom-post-type-24/page/2/?output_format=md)

 *  [Bree](https://wordpress.org/support/users/lifesgood/)
 * (@lifesgood)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388881)
 * 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!
 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388882)
 * Lifesgod, I found a different solution: [http://codecanyon.net/item/user-bookmarks-for-wordpress/544129](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.
 *  [Bree](https://wordpress.org/support/users/lifesgood/)
 * (@lifesgood)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388883)
 * 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?
 *  [Bree](https://wordpress.org/support/users/lifesgood/)
 * (@lifesgood)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388887)
 * I have rolled back to 1.5.6 and it works again…
 *  [thatwastaxing](https://wordpress.org/support/users/thatwastaxing/)
 * (@thatwastaxing)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388906)
 * Thanks lifesgood!
 *  [aronjeney](https://wordpress.org/support/users/aronjeney/)
 * (@aronjeney)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388908)
 * Is this really the only way for custom post types to work? Is there any difference
   in the code somewhere?
 *  [alexsean](https://wordpress.org/support/users/alexsean/)
 * (@alexsean)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388909)
 * 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> ";
          wpfp_remove_favorite_link(get_the_ID());
          echo "</li>";
       endwhile;
       ```
   
 * with
 *     ```
       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> ";
           wpfp_remove_favorite_link($post_id);
           echo "</li>";
       }
       ```
   
 * Hope that helps someone.
 *  Thread Starter [maxj](https://wordpress.org/support/users/maxj/)
 * (@maxj)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388910)
 * alexsean I own You!
 *  [Tech4Eleven](https://wordpress.org/support/users/tech4eleven/)
 * (@tech4eleven)
 * [13 years ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388914)
 * 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.
 *  [Bree](https://wordpress.org/support/users/lifesgood/)
 * (@lifesgood)
 * [13 years ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388916)
 * Thanks Alex – this worked for me too!
 *  [Tech4Eleven](https://wordpress.org/support/users/tech4eleven/)
 * (@tech4eleven)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388918)
 * [@alexsean](https://wordpress.org/support/users/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.
 *  [alexsean](https://wordpress.org/support/users/alexsean/)
 * (@alexsean)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388919)
 * 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.
 *  [Tech4Eleven](https://wordpress.org/support/users/tech4eleven/)
 * (@tech4eleven)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388920)
 * ok thanks. my page template’s ajax still doesnt work even with 1.5.8 but i’ll
   keep looking.
 *  [websta](https://wordpress.org/support/users/websta/)
 * (@websta)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388921)
 * alexsean, your fix worked perfectly on custom post types.
 * <Does the “88 miles per hour” dance>
 * Thank you!
 *  [Flick](https://wordpress.org/support/users/felicity_gilbertson/)
 * (@felicity_gilbertson)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-24/#post-3388922)
 * 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() ); ?>
       	</div>
       <?php endwhile; // end of the loop.
       ```
   
 * This way you can display the list of favourites anyway you like…

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/custom-post-type-24/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/custom-post-type-24/page/2/?output_format=md)

The topic ‘Custom post type’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-favorite-posts.svg)
 * [WP Favorite Posts](https://wordpress.org/plugins/wp-favorite-posts/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-favorite-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-favorite-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-favorite-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-favorite-posts/reviews/)

 * 20 replies
 * 12 participants
 * Last reply from: [Ata JBZ](https://wordpress.org/support/users/ata-jbz/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/custom-post-type-24/page/2/#post-3388934)
 * Status: not resolved