I don’t know if it is a typo, but your custom post type name is incorrect, it cannot have spaces, and also you should just use underscores to separate names in custom post type names
register_post_type('blog posts', $args );
Is it just blog
or blog_posts
In your query in your widget, you are querying the custom post type blog
, which does not match your registered custom post type.
Last note, you should not use extract()
at all. Look at the Widget API on how to coreectly construct a widget
Related Posts:
- Where to put my code: plugin or functions.php?
- Custom Post Type Data in Sidebar widgets?
- Including Custom Post Types in “Recent Posts” Widget
- Limit widget to a specific registered sidebar
- Include custom post types in categories widget
- Including a custom post type in the Archives widget
- How to embed form data within the ‘Add new post’
- Add custom post types stats to a custom dashboard widget
- How to create another version of the Category widget?
- ‘Pages’ widget alternative for custom post types?
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- right_now_content_table_end function not working?
- Custom Post Type Loop throws 500 error when used in widget
- How to create Blog Post Specific Widget
- Custom page sidebar using Template dropdown box
- Random image from tag/custom type on sidebar
- Register widget only page is a singular of custom post type
- Widget: Custom Post Type Post Listing Dropdown on Admin Side
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- Custom Widget WP_Query problem
- Hide a widget inside a div on specific type of post
- Filter widget outputs
- Set Custom Post Type in Widget Settings for use in Widget
- Want to be able to sign up subscribers as authors
- the_post_thumbnail call removing li in code
- how to set a WP Plugin’s url
- How to get dropdown instance value in WordPress custom Widget
- Post Query not working
- Methods for development wordpress themes [closed]
- display custom post type in widget aera
- Truncate custom post type content
- How to exclude categories from a sidebar with active widgets in it?
- Replace Content of Sidebar on Custom Post Type
- Custom Page Template – Widgets of wrong sidebar
- Widget area for individual posts (custom post type)?
- How do I get the posts from single page custom post type from a sidebar to display in a page?
- I want to link an author to everything from any post type that they publish on the website
- retrieve custom post image through widget
- Custom post type not being pulled in widget
- Custom post types archive
- multiple custom post type category selection search
- how to override menu widget?
- Displaying database table in backend of wordpress
- Filter CPT based on meta box value using Flexible Posts widget?
- Creating Multiple Admin Widget Page with Calling One Sidebar
- fetch meta fields inside a widget
- Radom post image/link based on custom taxonomy
- empty dashboard for custom role
- Code in custom widget queries all posts, when it should only query the current post
- How to add post type in masonry posts elementory widget
- Post_type doesn’t work for widgets?
- How to display custom message for (Genesis) featured posts if no posts
- Query by post title
- WP insert post and custom taxonomy
- Assign a Custom Role to a Custom Post?
- Implementing “Video of the Day” Feature?
- echo value from ‘select’ field type into page template using cmb2?
- Undefined property: stdClass::$labels in general-template.php post_type_archive_title()
- Genesis Child and Custom Post Type
- Best way to arrange custom post types by Attributes -> Order metabox value?
- Separate Custom Post Type Taxonomy by Comma
- CSS for Custom Post Types
- Display “Post 2 of 4” on single post page?
- Query post types with multiple keys
- How to generate a sitemap with custom posts (not Google XML)
- Displaying the type of post (Custom) in a single.php
- If Statement – if current post is a child of a post with a taxonomy
- Rewrite slug for CPT
- Which post does a taxonomy term belongs to?
- Remove the parent slug in a CPT URL
- Custom Post Type – No Results Found
- Including metaboxes from custom post types in global search — continued
- Custom posts type for individual pages?
- Custom Taxonomy not displaying all post
- Shortcode is displaying the content on top of the page [duplicate]
- Archive page for custom post type and custom taxonomy
- Custom loop to query posts with no featured image and/or no post editor content
- Custom post type ‘Show on screen’ didn’t apply to number
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Show 10 newest post for each value of a custom taxonomy
- WordPress giving me the index
- How to customize custom post type’s list table?
- Query to show post current day
- Using ACF values in nested WP queries for CPT with date values in the past
- SELECT custom post type and its meta in SQL
- Trying to list years (for a filter) but not all years display
- CPT tags not showing when editing post
- Assign for all post of a post type a specific single-post template
- Display custom tax in “while” loop
- Overriding a CPT template file through functions.php
- help me to display featured image of specific post by post id
- How do I retrieve the title of a term of a custom post type with custom taxonomies?
- 404 custom post type
- Displaying WordPress Parent field in child post
- Custom post tag images not displaying with ACF
- How to assign custom post template to its custom taxonomy terms
- Excluding top level from taxonomy and post loop
- Paginating custom query on category template
- Get a list of categories ids
- Styling first post using Advanced Custom Fields