<?php // query for your post type
$post_type_query = new WP_Query(
array (
'post_type' => 'pelicula',
'posts_per_page' => -1
)
);
// we need the array of posts
$posts_array = $post_type_query->posts;
// create a list with needed information
// the key equals the ID, the value is the post_title
$post_title_array = wp_list_pluck( $posts_array, 'post_title', 'ID' );
var_dump($post_title_array);
?>
Related Posts:
- Limit the post for differents custom post type in the same wp_query
- Limit the post for differents custom post type in the same wp_query
- Restrict custom post type to only site administrator role
- How to force one column layout on custom post type edit page?
- Setting a custom sub-path for blog without using pages?
- WordPress REST Create Post of Custom Type
- array_pop() expects array, boolean given for $event_type_term ->slug
- Custom Posts on Different Pages
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Multiple Content Block
- Display Custom Post Type in Recent Posts
- IF statement in a do_shortcode
- Slug for standard post post_type
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- How do I create an archive page for standard posts?
- Remove parent from custom post type
- Remove All, Published and Trashed Post Views in Custom Post Type
- Blog page showing same content as homepage
- Create a post in custom post type using field in registration form after users submit form
- Need help targeting a custom post type with conditional tags
- How to add post_type=value when editing that post type in the WordPress admin?
- Open Custom Post Type as PDF
- Show the same Article Available in Other Categories
- Show custom post type filtered by category
- Display random posts, but omit the post it is on?
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Meta query for custom post type ignored in main query
- Update Post Meta for a logged in user
- Get related posts of child term of custom post type
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Display post content with respect to its title?
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Load Next Posts With AJAX not working with custom post type
- Permalink misbehaving in Custom Post Types
- wp_insert_post wrong post type [closed]
- Can I change my post type to anything and my site still work?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- display posts of custom post type with custom taxonomy
- Modifying the default post from wordpress
- Post Query not working
- How to filter url on post submission?
- Custom Post Type Field Array parsing [closed]
- Different structure/content for posts from a custom post type
- creating files for displaying different custom post type posts with paging
- is it possible in a custom post, create custom fields as well whitin?
- custom taxonomy listing returns no posts
- How to controll the Posts post type and general wondering about WP data structure
- Display author box on just certain category posts?
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Am I mixing up the concept of posts pages and categories?
- If/Else child list for Custom Post Type single template within loop?
- Order posts by years
- redirect after submiting post for review
- How to achieve a multi-taxomony layout with posts?
- i need to have a tab with gategory post
- Custom Post type to Woocommerce Product type
- How to change Elementor Template for Single Page Post on Load
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Enforcing a rigid reusable template structure for similar posts?
- Auto delete pages/posts without views
- Query when is one or several values
- Show custom post status when logged out
- WordPress retrieving $post based on random key in $_POST
- minimize wp_query call to database
- Post display in separate page [duplicate]
- Limit posts per page depending on the size of a div?
- Delete Post by User
- Setting up a page to house certain types of posts
- How to create a discussion post when a custom post is created?
- Only show current category post
- WordPress Contents Migration
- Problem to get the link of the default ‘post’ post type like the orther custom types
- Featured image in custom post is being disabled
- How to set class to “current-page” on the currently viewed single post within a CPT
- Getting wrong ID
- CPT and metabox: create multi checkbox by using array?
- Pulling in Related Posts based on Post Type array
- How to make post page unique and show it on home page?
- Custom Post Types and Posts are mixed
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Retrieving IDs of child pages which are in a different post type
- Query Posts From Multiple Post Types
- WP Build-In Post selector for CPT
- post in a lightbox?
- Cannot exclude particular post from loop of custom post type
- How to make a template for a specific post of a custom post type?
- the_content() stop images being pulled through
- How to hide home title on pages and posts?
- Apply text based styling done for a single post in WPBakery to all posts / create a template out of it [closed]
- How do I hide single category post on my post page
- Different layouts for different post types in wordpress?
- Front end post or photo or both
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Two pagination in one page without AJAX
- Change post-name when inserting new Post if Specific Category is selected in WP
- post__in select all custom posts and not the selected array of ids