Title: Get Custom Post Type ID
Last modified: August 21, 2016

---

# Get Custom Post Type ID

 *  [Mike](https://wordpress.org/support/users/manndtp/)
 * (@manndtp)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/get-custom-post-type-id/)
 * Rather than putting the add to favorite link on the post page itself, I want 
   to add a link to each post on a list of posts of a custom post type page. I have
   create a small piece of code that grabs the ID, but cannot seem to get it to 
   work with this plugin:
 *     ```
       $permalink = $property['permalink'];
       $post_id = url_to_postid( $permalink );
       ```
   
 * The code works to grab other information from the individual posts (number of
   photos for each property). Any help is appreciated.
 * Should mention that the above code gives me the post id, which is used to grab
   the information. Looking to see how I can integrate the post id in with wp favorite
   posts on the page of posts. Right now it is just grabbing the page id.
 * [http://wordpress.org/plugins/wp-favorite-posts/](http://wordpress.org/plugins/wp-favorite-posts/)

The topic ‘Get Custom Post Type ID’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [Mike](https://wordpress.org/support/users/manndtp/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/get-custom-post-type-id/)
 * Status: not resolved