As Tom J Nowell mentioned in his comment, it is not clear what do you want to accomplish. If you want to just show your empty content div
, you can use CSS as follows:
div:empty {
width: 100%;
height: 20px;
margin-bottom: 10px;
background: #ff0000;
}
It will show your empty content div
as a nice, red band.
Related Posts:
- How to know if get_posts() failed?
- How to get previous 10 days post from a specific date – WP Query
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- posts_per_page option limits the number of Gallery items
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- Related Posts function not working
- Show 5 posts and than 3 posts offset with pagination
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Get the ID of the latest post
- WP_Query vs get_posts
- Random sort within an already sorted query
- How to display posts by current user/author in a custom page template?
- Get posts by meta data OR title
- Query posts distinct authors
- WordPress Number of Posts Not Changing With posts_per_page
- Query only Posts from Both of Two Category?
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Search query – exact post title match
- posts_per_page doesnt work
- How would I get 1 latest post from a query for 5 posts?
- Can I set and show “important” post in my blog?
- How to start with post number x?
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Reset Popular post query?
- Get Posts that are in the current month or later
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Why is querying posts messing up my pages?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Exclude the first ‘n’ number of posts of a tag from home page?
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- How to get posts from a current post’s month?
- Nested WP_Query breaking loop
- How to get posts and comments amount per hour, per year and per month?
- While loop articles – if statement order
- Why Query is returning empty array?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- why the same code got different results when using query_posts in functions.php and index.php
- Display Posts with template on a Page
- How to get posts published on the latest date?
- Post Filtering by GET URL parameters
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- WP_Query: Show 10 posts in date order, first three random
- Exclude some posts from displaying in wp_query based on some condition
- Random posts that always include a particular post?
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- How to convert query sql to shortcode in wordpress?
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- How to show multiple posts thumbnail, title and date in widget
- WordPress Query – Display 5 posts (same post type), each from a given tag
- How to merge the content of posts that have the same title?
- get posts, run a custom query, and join the results
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- How to fetch courses in all languages in WordPress?
- Multisite how to display merged posts from two sites and sort by latest date?
- Fill the exclude array() in get_posts()
- filter posts based on menu_order
- wp_query args with relation
- WP_Query to get posts in a specific tag or has post_format
- Manipulate query to show specific post
- Querying posts from current category, using a variable as array argument
- Sort Events by Venue Title – Sort Post set by related post ids
- wp query custom orderby not custom field
- Ordering Posts by parent category, name ascending
- Query post category & remove any post id
- Advanced Post Display/Pagination/Ordering
- Ordering posts alphabetically by meta keys and title
- How do I control the fallback query after the original query returned cero posts?
- When should you use WP_Query vs query_posts() vs get_posts()?
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Displaying Results From Custom Taxonomy Query
- WP_Query retrieve custom posts but not the post showing
- How to get all post titles starting with numbers and symbols?
- How to limit post query to only return a total count of items with certain post statuses?
- How to get single post by one author?
- Wp_query WooCommerce products
- posts_per_page – Repeats only first posts ‘post__in’ array
- query_posts different amount of posts per page [duplicate]
- Word count for all posts of all authors