Don’t know if this is solved yet since the post is so old, but you’ll probably have to edit this file (non-upgrade safe manner) in order to do it. Try doing what this guy recommends: Show default content if custom WP_Query has no posts
Basically, create an else
statement where the code you pasted above says endif; endwhile;
.
Related Posts:
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Custom Post Type Loop throws 500 error when used in widget
- 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
- Genesis Child and Custom Post Type
- Include custom post types in categories widget
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Including a custom post type in the Archives widget
- How to embed form data within the ‘Add new post’
- Edit/Customize the Single Page of a Genesis Sample Child Theme
- 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?
- Custom Blog Post Listing in Genesis Sample Child Theme
- right_now_content_table_end function not working?
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- How to create Blog Post Specific Widget
- Problem with WordPress query on page using custom fields
- 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
- Why isn’t a list of posts from my custom post type displaying in this widget?
- Move Genesis Single Page/Single Post Title
- Add an Outside Wrapper to my Header and Make it Full Width
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- How to get dropdown instance value in WordPress custom Widget
- Query to get child pages of current page and display it in action hook
- Post Query not working
- Methods for development wordpress themes [closed]
- display custom post type in widget aera
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- 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)?
- Custom Pagination based on 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
- Menu disappears with custom post type link
- Custom post type not being pulled in widget
- Different read-more link for each custom post type [closed]
- 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?
- WordPress URL Problems and Layout
- 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?
- Create side bar widget showing list of years as hyperlinks for a custom post type
- Custom Post Type posts not getting picked up in archive widgets
- Using a custom widget to add data from a custom post type into the sidebar
- Capability to edit own post, but not create new one
- Can’t use orderby in WP_Query
- Custom Post Type Categories Not Maintaining URL structure any more
- Why won’t this rewrite rule work?
- Custom posts affecting Recent Posts
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- CPT unsaved draft gives error 404 – when Post Formats support enabled
- Custom Post Type meta oembed html output resulting in WSoD
- archive-{custom_post_type}.php not getting recognized wordpress
- Custom post type single display is ommited
- Customizing the custom post type permalink
- Paginate custom taxonomy category with wp_custom_pagination
- Comments not enabled for custom post types
- Fetch post meta in the same query as the main loop
- Redirection error after posting a comment on a custom type post
- Repeatable WordPress custom fields in a metabox
- Archive.php is not displaying tags
- Unable to get the upcoming events for custom post
- How to retrieve the permalink for a specific (custom) term?
- Filter RSS feed for custom post type to events for next 7 days only
- Meta-Box to add multiple items one at a time and on publish save all
- Redirection loop error after login from a custom post type post
- Values inside a custom field to determine which category posts to display
- remove custom post type ulr
- Page to show custom posts and one category
- CPT, Custom User Role and problem with user manager
- Change custom post status to draft before today
- CPT archive as home page
- Custom meta box data not saving after wrapping in class