You need to add:
'supports' => array('title', 'editor','page-attributes','thumbnail')
add this to your array after ‘singular name’ => ‘pictures’.
The thumbnail adds the featured image option to your post type.
You can access the post type archive: yoursite/archive-pictures, this will use your themes archive.php file if it exists.
Or you can create a custom post type archive template with a custom loop: archive-pictures.php.
Or you can create a custom page template and apply it to a page.
Both the post-type archive and custom page template would contain similar code: a custom post type loop like this:
$args = array( 'post_type' => 'pictures', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
the_post_thumbnail("medium");
echo '</div>';
endwhile;
Related Posts:
- Submit post and upload image from front-end
- Linking Two Post Types
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- Problem excluding category from get_next_post
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- How to let custom post type posts show in standard post archive (like in homepage)?
- Rewrite custom post & taxonomy to share same URL path
- How do I write this SQL statement for Posts written in last 24 hours?
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- Change Post Title Edit Box
- Disable feeds for specific custom post types
- Get the post children count of a post
- Disabling post_type in URL
- Quickest way to get last or oldest post date – WP Query
- Before Delete Post
- How to use custom fields to enable sticky posts on custom post types?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Check Title Unique Or Not and If not error message and dont save
- I am having a problem with form updating/editing WordPress post on the frontend
- How to filter the taxonomy terms based on another taxonomy term
- get_template_part for custom post type content not working
- Show Two custom Post type and their posts on category page
- count_many_users_posts except current logged in user?
- Custom post type and body_class: Remove “blog” class
- Shortcode for display posts on home page show only one post
- Find the user who initially created the post
- How to get the post type from a category id?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Getting posts under the custom post type ui category
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Add custom post type settings to wordress default posts
- JS innerhtml changing style when using AJAX
- Side effects of Script and Iframe in post
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- Admin Column does not populate with data
- Limit the post for differents custom post type in the same wp_query
- Some posts from custom post type to subdomains
- How can i create an custom post template for an specific post category? [closed]
- how to check if custom post title exists or not?
- Modify previous and next post links to current Authors Other posts
- wordpress remove views from action links in a custom post
- Stores category posts in an array
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- Generate new post from email
- YOAST SEO won’t work on custom post type archive [closed]
- Batch Extract Date from post title and put into ACF custom field
- Get post format
- Use post in multiple places on a page with multiple posts
- Custom post type tags not showing in search
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Custom post type filter is being applied to all of my posts
- Admin slow on Postlist (over 30k Posts in Database)
- Get_post_custom not fetching value from array wordpress
- Display Parent-Child Posts in specific order by comparing IDs in array
- Post category behave like a Post in back office menu
- Save data is post using php front end
- What is the best way to structure posts for the same event happening in different years?
- How to display custom field in product description?
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Custom page with no headers, footers and its own CSS, Javascript
- SEARCH QUERIES – REVERSE OUTPUT
- Is there a way to create a sidebar of bullets
- Get queried object for custom post type count
- edit.php all post not working
- I cannot display custom posts in custom taxonomy
- post type => ‘any’ not applied my custom queries
- How can I get the last 5 element of this tax query?
- Using Orderby and meta_value to order natural/alphanumerical
- How to get the posts that my following users are liked?
- How to insert post 6 times after user register like ask.fm
- How can i order my posts by post type?
- Creating custom post type relationships
- How to mark posts as visited
- creating a custom post template
- How To Loop Through list with Custom Post Types
- Adding Information To All Posts Screen
- how to edit custom fields of type gallery from front-end
- Different post types arranged on one page
- erase post excerpt limitation [×]
- Post Editor: display categories from current post type taxonomy only?
- Display all post types together
- custom field suit new post with in custom fields
- Using predefined html in new posts
- Change display wp post type to wp custom post type
- Pulling in a particular post into a single page based on the post id passed into the code
- Custom My account page and custom page for editing posts
- Can a user drop a HTML Shadow DOM into a blog post?
- show only one category posts in admin
- Get post from custom post type that title is like custom string [closed]
- show posts under custom post type with same autj
- How to automate the creation of advanced layout article/post
- Sort ACF by custom taxonomy