1) Blank page in WordPress means, there is a fatal PHP error in your code. Also the or die()
statement could cause the white page. You should not use or die()
in production code, instead use try .. catch
2) Besides this I strongly discourage you from using mysqli_* functions in WordPress. Always use $wpdb
for DB access!
3) Your query has some issues, but those will not cause the blank page but possibly incorrect results.
4) In this case you possibly want to use core WP functions instead. Like get_posts()
and get_the_category()
Related Posts:
- Query posts from current year
- WordPress custom Query for Posts in Category display posts multiple times
- How can I setup a relationship using categories in WordPress?
- Migrate posts from category and sub-category via SQL
- SQL Bulk Move old posts by one author to another category
- How to display only one category in a custom post type?
- Export all posts to import as product items
- Get current taxonomy and display query accordingly
- AJAX load more posts not using correct category and repeating the same few posts
- Querying posts from current category, using a variable as array argument
- Query posts from newest category
- Query post category & remove any post id
- Sort post by category using HTML Select tag
- Special Query: Title, Terms, Content – %LIKE%
- The page that displays Posts on homepage
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Change permalinks in posts via SQL
- Batch Scanning and Deleting Empty WordPress Posts
- How to add category to: ‘wp-admin/post-new.php’?
- Use category base slug in posts’ permalink
- Random sort within an already sorted query
- Setting Custom Sort Order of Posts within a Category
- how to get a different html for odd/even posts?
- Display the latest post from a category in a page
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How to control which category will be picked for the slug of a post?
- WordPress Number of Posts Not Changing With posts_per_page
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- Display most recent post in category instead of archive?
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- Get user’s most published categories
- Conditional that checks if a current category has any subcategory with posts
- How to set post expiration date and time and move the page to archive after expiration [closed]
- Get posts by multiple ID’s (query)
- Exclude posts with empty post_content in wp_query
- Exclude posts from featuring
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Bulk update post slugs through database
- How To Remove Certain category Posts From the Blog Page
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Add icon/badge next to posttitle of specific category
- Delete WordPress posts from URL list sql query
- Get current category id from post page wordpress
- Sticky post appears twice
- How Can I Query a Specific Page From a MultiPage paginated Post
- Saving category to a post, before publishing the post
- Assign category to new post via URL
- Stop users posting into category while still seeing contents of the category
- Category Page Template not Showing Posts
- filter RSS feed in URL
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Categories list into registration form
- How to display two random-post sections that are each under their own category
- How to create a sub post?
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- how can i display my posts alphabetically?
- Change Post Title For Specific Category
- Related Posts function not working
- In what context should Categories and Tags be used
- list posts from two categories on a page – plugin not working
- How to create a playlist for audio associated with posts per category
- posts going to 2 pages/categories only show up in 1
- Display Parent Category of a Post belonging only to Subcategory
- Prevent duplicate pages from being added
- Can I style single post that are in multiple catergories?
- Show 10 latest posts only from users with contributors role
- Rewriting blog permalinks
- Return records between two meta datetimes saved as strings
- How to make ajax load posts from the current category?
- Show single post child category from a determined parent
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- I want to add the 10 most recent posts under a parent category on the main menu
- how to filter posts by category without page load (ajax) in wordpress?
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- How to distinguish pages created by woocommerce?
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- insert post fails after multiple postings
- I want to show recent post according to category of the post in single.php?
- Limit amount of categories displayed in a post
- Count posts for pagination
- Category and Posts in front page
- Allow registering user to select post category when signing up to blog
- Sort Events by Venue Title – Sort Post set by related post ids
- Add category information beneath post?
- Newly created category does not show category
- How to pass multiple checkbox values to wordpress query?
- Show a Category Specific Info Box
- Display the first post’s comments of category in comments.php template
- How to filter categories of a post
- List posts related to category on a div [closed]
- how to show all post with its contents
- How to set value in Query Loop?
- Wp_query WooCommerce products
- How to display my categories in a list (to a post, not the sidebar)?
- How to make category for word post_content
- Filters do not work when there are multiple (one works)
- I am using the query block and what I want and see on the editor page is not the same with the actual results