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?
- How to get the posts of a custom taxonomy term
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Custom Post Type menu name
- Get Custom post with ID
- Adding %author% in custom post type URL structure?
- Syntax to get the Nth item in a list of custom post types?
- Filter by custom Field for Custom post type Admin Listing
- Problem excluding category from get_next_post
- remove support for ‘Categories’ for a custom post type
- Display different gutenberg template from selected post attributes
- Detect if 1st, 2nd or 3rd level custom page?
- Display custom post data in sidebar w/ dropdown
- Using global $post; to get featured image for custom post via WP_Query
- Hide specific parent categories from post edit
- How do I order multiple custom post types in the same menu position ( menu_position = 20 – below Pages)?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Flush Rewrite Rules when new site is created on network
- Inserting custom fields into single.php
- Is it possible to have “two” sets of tags?
- How to: Add a publish immediately button when editing custom WordPress posts?
- Custom Post Type author filter not working
- Adding admin menu seperators around CPT’s
- Changing an item in drop down after 5 latest posts per taxonomy
- Custom Post Type categories at edit post not hierarchical
- Loading a template for a URL pattern
- Best way to insert a js script in the header with custom fields and CPT
- Display a custom post type list by taxonomy term
- Give Friend Post Management
- One set of categories for multiple custom posts
- sidebar hierarchical menu category & custom post type
- Why does wp_generate_uuid4() timeout?
- Delete Term from Custom Taxonomy using wp_delete_term isn’t working