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 get a list of all posts and their categories?
- Add a category to posts, that DO NOT contain two specific keywords?
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- How do I stop the loop from repeating in my category template?
- get_the_category listing in hierarchial order
- Is it possible to add/tick a category to a post when it is created?
- Excluding posts not working
- Exclude current custom post on single post
- Hide posts belongs to few categories in homepage
- why does wordpress ignore the post args?
- Dynamically switch template on click
- How to get posts and comments amount per hour, per year and per month?
- post category in wp_insert_post
- Get all custom post types excepted some…
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Get all comments of author’s posts
- First x post with another template then the others
- Why Query is returning empty array?
- How to get subcategories from category slug?
- Remove current category from post but display all others
- How show categories in admin and get that selected to show posts in index
- Delete all drafts?
- WordPress website loads more posts than expected
- SQL Command for restoring trashed comments
- Showing categories and subcategories with posts
- Change default category when I publish a post
- Wrap every month posts in div
- store posts_id of category into a varable?
- 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]
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Loop doesn’t exclude the specified category in home page
- Do not show children of a category
- post__in not working with pre_get_posts, but post__not_in does work
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How to create a sub post?
- Post Image not displaying in category view
- Can’t get full post title if there a spaces in title
- How to get all post_parents of a post?
- How do I show posts from another wordpress installation?
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- get posts from Custom Post Type & Category
- Category page when using static front page
- Latest posts by category — how to exclude current post?
- Query posts and filter at query time by value of custom meta
- Run query_posts if SESSION is empty?
- How do I include the category next to the title of a post?
- Relative number of post in category
- How to create a “latest news” page showing a list of posts from blog category
- Overriding default calendar to show posts from a category
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- Very complex post query
- how to hide empty fields of post category description?
- Delete post revisions only for a single post
- how can i display my posts alphabetically?
- if in category but only with post meta
- How to get post with associated categories and tags names instead of ids with rest api?
- How to Assign / Move all Deleted post to a category
- Display a mixed list of posts and media
- Parent category / child category posts
- Posts Missing in Dashboard after update
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- How to give classname to post if post has no content?
- Display post by click on the link
- Sort by last word in title
- Display post number by category
- Queries take 120+ seconds on my large WordPress site
- singular posts using archive styling
- Exclude some posts from displaying in wp_query based on some condition
- Change Post Title For Specific Category
- Display selected categories onto post page
- How to call posts under a specific category on static front page?
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?