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?
- Including categories in search results
- Count how many posts in category
- Custom Single Post By Category
- Convert custom fields to post categories
- Using $wpdb to query posts with meta value containing current post_id
- how to get permalink using sql
- Show One Category on Post
- Order post by year DESC and month ASC
- How can I display a specific user’s first published post?
- Do I use custom post type or something else?
- What Defines What Category A Post Picks (if in multiple)
- Limit function to specific post category
- Show all post titles
- Add Category name to Post Title (h1)
- Posts are not showing up on particular category
- How to display related posts by subcategory and not parent category
- Category Template: Need to display different content on first page of archives
- Get posts by name and taxonomy term
- Get Posts that are in the current month or later
- Display post category in foreach loop with category link
- Extracting post categories
- Get Meta Key Value While Saving Post
- How to limit posts by category
- How to verify wp user password by sql query in wp? [closed]
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- Get user categories with most posts in it
- Using ajax on editing a category edit page?
- How to make multiple sections in home pulling posts category wise?
- How to get posts and comments amount per hour, per year and per month?
- How to get subcategories from category slug?
- Change default category when I publish a post
- Loop doesn’t exclude the specified category in home page
- Post Image not displaying in category view
- Can’t get full post title if there a spaces in title
- Parent category / child category posts
- Exclude post category in a blog page
- WP_Query of Category Not Showing First Post
- How to make posts being uncategorized
- How to display a single(current) post from a category
- displaying the categories post
- What’s a theme that properly handles previews of different types of posts?
- Custom Select Query – Selecting the Year?
- WordPress, custom post type and posts query help!
- How to add content above footer in posts from specific category
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- WordPress Query – Display 5 posts (same post type), each from a given tag
- How to Create another Page Category like the “Post” and “Pages”
- Ignore posts content in the posts queries for internal linking
- How to create a button to filter posts (list) by meta value
- Is there a way to save different data when USER interacts with the same POST?
- How to display particular categorie’s post which associated to specific user?
- Display Specific Categories posts on the home page
- show only one category and filter by tag
- Code to display random ordered posts in Categories across pages [duplicate]
- Category posts show on local install, they do not show on live server
- How can I exclude only a specific sub category post from category display?
- how to print total number of posts filtered by category?
- Is it possible to remove actual post pages in wordpress but keep them in categories
- Need help with hiding an image within a post in a category
- WordPress not showing recent posts
- How to get post count including nested categories
- How to filter out post from a category not its subcategory in wordpress dashboard
- Export Posts with specific custom fields by sql
- How can I display a specific number of post in a category via a url
- how to chang preview of list of articles of one category?
- Advanced Post Display/Pagination/Ordering
- Can’t create posts with WP DB Abstraction Plugin
- Post of a specific category – not to be seen in paging previous/next post
- How to show main category related to that post
- Display selected category on post page
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to use in_category?
- About number of posts in selected category
- WP_Query retrieve custom posts but not the post showing
- Category page shows “No Posts” but I do have two assigned
- Exclude a ‘portfolio’ custom category?
- ‘get_previous_post’ in same category returning (!empty) when no previous post in category exists
- excerpt in template for specific page
- Only show posts belonging to multiple cateogries at same time
- Wrap posts from a category in HTML
- How to make WP_Query faster when getting a post from one year ago?