Below Code will generate Select box of post type “resources” change this value as per your post type.
<select name="page_id" id="page_id" class="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value="">Select Resource Post</option>
<?php
global $post;
$args = array( 'numberposts' => -1,'post_type'=>'resources');
$posts = get_posts($args);
foreach( $posts as $post ) : setup_postdata($post); ?>
<option value="<? echo get_permalink($post->ID); ?>"><?php the_title(); ?></option>
<?php endforeach; ?>
</select>
It works for me.
thanks
Related Posts:
- How to select one major category (or custom taxonomy) for a custom post type?
- Add “Select All” to custom taxonomy
- Create a page selector using taxonomies
- How to get all taxonomies of a post type?
- Permalinks: custom post type -> custom taxonomy -> post
- Efficient Taxonomy Intersection
- Set relationship between custom_post_types
- Remove admin menu for custom taxonomy attached to custom post type
- How do I list custom taxonomy terms without the links?
- Page not found taxonomy custom post type
- How to list custom taxonomy categories?
- clients list using wordpress
- Custom taxonomy query for a custom post type
- Extend walker class with custom post types [closed]
- How to do a custom bookmarks post type?
- Getting taxonomy terms used by custom post type
- Taxonomy list. Order by a specific custom post type count
- Rewrite CPT slug with two taxonomy slug instead of one
- How to display Custom Taxonomy of Custom post type
- associate custom post type with tags with specific pages
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Custom Taxonomy breaking pages permalinks
- How to customize admin posts based on the user who is logged in
- taxonomy template for custom post type the same as the archive
- Get categories and descriptions from custom post type
- Custom Post Types for Support Ticket plugin?
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Repeating posts when paginating random posts
- How to use the post_title of custom post type as taxonomy
- Custom Post Type Archive Page Filtering
- Custom Post Type doesn’t show Draft and Trash Options
- Custom Post Type With Categories
- Missing Posts in Custom Taxonomy List
- Custom Taxonomy back-end customizations
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- browse by category and tags?
- Taxonomy structure help
- Create more category hierarchical depth for custom post type/taxonomy plugin (widget)
- How do I share categories across multiple post types?
- Migrating a taxonomy’s tags to the native category
- Show custom post type inside a custom post type
- What’s the name of the custom post type yearly archive template?
- Combine multiple getEntityRecords calls
- Custom URLs in post types make it impossible to view archive
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- How to check if post/page or taxonomy post is published by admin
- Custom taxonomy or custom page templates?
- Permalink problems with custom post type and custom taxonomy
- Get terms of a post but only if they’re also the child of a specific term
- Custom Post Type Categories URL not displaying posts
- Custom order of Taxonomy Terms
- Custom Post Type Advanced Slug
- filter by custom taxonomy using ajax
- Custom post type subtaxonomy template
- tax_query (if the terms are empty)
- Getting only one post per category
- Should putting custom code in functions.php or created the plugins [duplicate]
- List all posts in taxonomy term
- Get posts by category name
- List child categories from parent category on custom taxonomy page
- Create a custom taxonomy template that loops through child categories in term order?
- Custom Post Types and Complex Content Hierarchy
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- How to Implement Search Functionality?
- How to implement very unusual wordpress routing structure?
- Post template with breadcrumb needs to show page navigated from
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Changing permalink of default Post with custom post
- get_queried_object not work in taxonomy page
- wp_insert_post deleting previous post custom meta
- Change custom post taxonomy values from front-end
- Pages of my taxonomy terms are showing all posts
- How to create a permalink structure with custom taxonomies and custom post types
- Is there a way to re-order the Custom Taxonomy drop-down on a Custom Post listing page?
- How to get all posts related to a taxonomy?
- Custom post types not displaying per category
- Custom Post Type tag taxonomy “Page Not Found”
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Hierarchical taxonomy in permalink structure
- Can I create a taxonomy term that mirrors the name of a new custom post?
- predefined custom field on registration page
- Displaying taxonomy icon outside archive page
- Why won’t this rewrite rule work?
- Archive.php is not displaying tags
- How to not have the items of the subtaxonomy within the parent taxonomy
- Select Menu for Custom post Type does not save
- How to save an integer as taxonomy term?
- Sort custom post type items by taxonomy description
- Tags and Taxonomy links not working for Custom Post Types
- Get custom post type parent category
- How can i change url structure of cpt like this?
- Custom taxonomy meta fields
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Problem with shortcode
- WP Query – Can’t get posts with specific taxonomy