This is the loop I’ve created to display post’s matching criteria on empty page:
// get results
$the_query = new WP_Query( 'meta_key=apaitei_logariasmo_facebook&meta_value=Ναι' );
// The Loop
if( $the_query->have_posts() )
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<h3>'; the_title(); echo '</h3>';
the_content();
}
wp_reset_postdata();
It works. Look at the image:
Note: my site’s language is English with:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
How do you know that your query returns no posts if you don’t display anything. At least the code you provided does not show it.
Related Posts:
- is_category() in pre_get_posts strange error
- Rearranging posts based on categories
- Custom Query to search through categories
- How to query all posts of a specific category, and any other category combination
- is_category in pre_get_posts results in php notices
- Query the Loop without breaking it
- How to Check if a Child Category is Being Queried
- How Do I Merge Categories With phpMyAdmin
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- If newest post of category is newest post in general, skip first post of category
- Disallow categories from this MySQL query
- Include posts from feature category in pre_get_posts
- How to display posts under a specific subcategory of a given category
- get_the_category and echo out link to child-most/deepest category
- query in category.php repeats itself
- Display posts separated by Category in Author’s page
- Category param redirect to post type archive
- How to get related tags based on a category?
- Show popular post by category code
- How to get latest posts from each category in regular order
- category pagination got broken suddenly
- How to query categories with Advanced Custom Fields?
- Where and when does WordPress invoke routes
- And/Or Category Query
- Exclude category from query
- Overriding default calendar to show posts from a category
- function query_posts disabling current_page_menu class
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- Using in ‘category_name’ in ‘$query->set();’?
- custom query for both category and pages using global $wpdb;
- Get categories of queried posts
- Query from multiple category (and)
- How to display posts from specific category using get_option function?
- SQL query to get posts from multiple categories but not in a category
- Conditional category query breaking?
- How to filter post from categories only if the posts appears in one of them, not the other?
- Category name for all posts getting assigned to a single random post
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- List of post categories only associated to another custom taxonomy
- how tho change number of posts in loop from specific categories
- Get category from slug list
- Issue with WordPress category search
- Querying posts from two different categories while looping inside another loop
- how to get postmeta info based on multiple categories?
- Too many categories drastically slow down my website
- How to get posts from many categories using WP_Query
- Is it possible to query the result of a query?
- show posts found in multiple categories via category_name query string?
- Match two taxonomies to display a specific content
- Category slug in in loop always the same?
- display certain category on custom template page
- Detecting top parent category fails on home page
- Displaying posts by year
- wordpress category.php query for featured news item, broken pagination and repeating posts
- How to show posts of a specific category
- How can I hide a category from Contributors in the edit/add new post screen?
- Category page doesn’t use category.php, instead it redirects to homepage
- Multiple post categories – single permalink
- How to exclude uncategorized from permalink structure /%category%/%postname%/
- Create product category and keyword search form in woocommerce? [closed]
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Saving two categories from two dropdowns in front end posting form
- How would you create a “weekly” archive?
- Exclude most recent posts from specific category in wp_query()
- Display all posts with same title
- wp_list_categories to show list of categories and the description
- How to display a description of a given category from a custom taxonomy
- Filtering by Category doesnt paginate correctly on the backend
- Direct link to category?
- How to modify category.php to list posts alphabetically?
- Sorting posts by season
- Create blog page only to see one category
- Looking for the best solution to build this Blog structure? Picture attached?
- Set Current Category to Active in category.php
- How to hide category description in the subpages? [closed]
- WordPress query via checkbox form
- WordPress Post # of # filtered by category slug
- wordpress multisite… collect all posts on main blog – exclude category?
- How to put an array in is_category
- How to add custom color fields to the category edit page?
- Target a specific category from a custom taxonomy?
- wp_list_categories with category description
- Category page returns 404 error
- Random category with recent post title and thumbnail
- prefix to post permalinks without affecting category permas
- How to add tags under categories
- How to add commentary types or category for a post
- show thumbnail for subcategory wordpress
- Pagination for custom categories template
- How to modify custom category field from front end?
- Excluding particular category from displaying in specified areas
- Bulk Change WordPress category Slug
- How to use categories, sub-categories and customize navigation view
- Adding a category view to a page
- make categories editor unchangeble for my post_type
- same permalink for parent category and child category
- WordPress Loop Prob
- Display post content from category name using ajax
- WooCommerce category display in custom page
- How to display the category featured images [closed]