how can i retrive all the movies, i retrive only the amount set in
Administrtor setings. How can i retrive the pages too
Assuming that $current_user->ID
is now correct, and it seems from your comment that it is.
$recentPosts = new WP_Query();
$recentPosts->query(
array(
'author' => $current_user->ID,
'post_type' => array('post','trailers'), // pull both posts and trailers
'showposts' => -1, // show all posts
'ignore_sticky_post' => true // my addition, seems like a good idea
)
);
Reference
https://codex.wordpress.org/Class_Reference/WP_Query#Parameters
Related Posts:
- Custom post type for ‘staff’ versus using wordpress user profiles?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Prevent trash/delete action on specific post types
- Custom post type support for get_users(‘orderby=post_count’);
- Front end registration/login & publish/update 1 custom post
- User roles – enable custom posts disable posts
- Allow User to Edit Page Based on their Email
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- How can I get the last posts by user role?
- Assigning a role to a specific custom post type (and ignoring other post types)
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- How to show custom post type count in the users admin page
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Delete Current Author Frontend user while delete custom post type
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Link users to a custom post type
- Ajax Check Post Status
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- how to delete all users and posts based on ‘user_meta’?
- Roles for Custom Post Types
- Is using taxonomies the way to go here or would custom post types be better?
- Hiding posts by other users and non-logged in
- Users create/join groups
- Disable user from updating certain posts
- Query posts based on the meta key values of logged-in users?
- How to restrict author to only access one custom post type ?
- Create custom post with custom user rules
- Associate multiple users to custom post type
- How to assign permissions for a CPT to a user
- Custom User role not working with custom post type
- get comments by current user inside page template
- how to associate several authors to a custom post type
- Assign post type to many users
- Check if user has comment on current post
- Query within a foreach within a query (queryception)
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Add a custom post when inserting a new user in WordPress?
- Preventing role reading others posts
- Order users by number of posts (includes custom post type)
- Plugin needed to allow subscribers to post articles on the front end without admin approval [closed]
- Display custom post front end filter by ACF equals current user
- users post count
- Clone wp-admin/users.php (Users Admin Page)
- Link custom post type to users membership
- Show all post type posts in manage users posts column
- Limit 1 post by user in each custom post type
- Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts
- Assign a Post to a User
- Add WordPress users to a custom post type
- Custom Post Type Query by user id
- Autofill advanced custom field with user data
- connect users to Custom post types
- Reference field of users in custom post type
- Custom Post Hierarchy and users
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Creating multiple profiles under one user to assign to particular posts
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Control what custom posts a user can see
- Associate custom categories to different user IDs
- Display and Allow users to edit their own profiles
- Check in function on custom page
- WordPress and Unity high scores table
- how to show Author post type count
- Combining Multiple Taxonomies in one URL
- Taxonomy term in permalink
- How to give a CPT (custom post type) a date based url
- Numbering sections and block-level elements in wpautop(); WordPress as CMS for long-form writing;
- ‘No pages found’ in Dashboard after registering custom taxonomy
- Issue with saving custom post type when editor is removed
- How would I leverage custom Taxonomies in this scenario?
- Using custom post types in submenu + custom title
- 2 different post->IDs for single page load only in Firefox
- How to show custom (checkbox) field value in admin post list?
- Using pre_get_posts to filter one loop in a multiloop archive
- How to Duplicate (multiple meta box)?
- Custom Post Type: Upload Multiple Images
- How Do You Add a Second “Posts” Menu to Your Dashboard?
- CPT issue: Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Is $object_type truly required with register_taxonomy()?
- frontend image post uploader
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- retrieve permalinks of posts inside custom post type by using post ID
- How to change base in tag URL for custom post type, to not use “Custom Structure” set in Permalinks setting?
- Custom post types sorting admin columns nothing found
- Different structure/content for posts from a custom post type
- CPT archive page – show one post from each taxonomy term
- Subpages Permalinks Issues
- Display custom post type from template
- Change Text in Admin Panel
- Adding a location field to buddypress activity
- How to generate auto shortcode for custom post type same as Elementor Template?
- I want to create a metabox under custom taxonomy
- Custom post type and custom page name
- Hierarchical Custom Post Type Walker?
- Changing menu label to post name for custom post type
- Remove Custom Capability
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Remove ?preview=true from the address of custom post types
- Changing to different post type maintains the redirection?
- Custom post type with custom parent prefix slug