As far as i know there is no arguments array key name 'post_category'
in WP_Query . Insted of 'post_category'
use either 'category__in' => array( 2, 6 )
or category_name' => 'staff'
.
And also for the id case use echo get_the_ID()
… to print the post id
Related Posts:
- get_users(…) only returns one user
- Open post-content in archive page in a Modal box with bootstrap
- Making (and edit existing) posts with ID included
- php return username of currently viewed author profile
- How to block specific user id in custom login form?
- Get current user id in function php
- Trying to get post ID outside loop on blog page
- Post from front end form to post_meta
- main menu page redirects to user ID
- How to use nonce with front end submission form?
- Integrating WordPress to my website, while keeping my own authentication system
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- get_the_content if it contains multiple lines it results in SyntaxError
- Looking to exclude blog posts from category Previous/Next buttons
- Authenticating to WordPress, using my own authentication two-factor system
- Automatic Excerpt Not Working
- Using a javascript file to access a get posts array
- Creating a Front-end based User Search
- How can I default to all WordPress roles when parameter is not included in shortcode?
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Delete option value from array using update_option()
- Uploading video to google drive via frontend [closed]
- How is WordPress manipulating the posts like there are folders?
- Passing the page ID to a login php script
- Trying to make php run in a post
- Remove posts after a given amount of time
- How to get a list of all possible values of a specific user meta key?
- Hide wordpress field if data is empty in post!
- How to show part of the_content?
- How to set a min number of words for a blog post
- Get post id in a function when edit/add a post
- Which hook/action will help me solve my problem?
- Loading index.php contents which located outside blog folder for post single page
- get post content of particular post by url
- Get children post mime type using parent post_ID wp_post
- Change CSS based on is_user_logged_in
- How to show a users bio on a page
- Pagination on Custom Post
- $wpdb returns duplicate posts
- How to avoid duplicates when creating recent network posts
- Update post title from external file?
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- set post limit at load more ajax wordpress
- How to use mysql LIKE with wpdb?
- Add new post in existing categories using wp_insert_post
- How do I add more options to the post-new.php page?
- Incrementing PHP variable onclick to display posts by month
- Do not duplicate posts with multiple categories in multiple loops
- show recent posts php code error?
- Post to WordPress from another Server via PHP
- WordPress Search
- Update value of a associative array with update_post_meta
- Redirect to current user page upon link click
- Use of antispambot with $curauth->email
- Edit and delete permissions pages and posts
- Generate a QR code when creating a new WordPress user
- Filter wordpress posts without searching the keywords in the post content
- Change wordpress’ database data using ajax – how to get current user id?
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Post form – AJAX won’t upload featured image – Plugin development
- posts_per_page displays only 2 posts instead of 4 posts
- how can I call a function when time expire
- How to get post titles by post ID and integrate with my code?
- Uploading/integrating custom user registration page
- Infinite looping next post link within a certain category on a post
- WordPress recent post
- Need to show 7 posts from actual date
- Can I disable auto increment of WordPress Posts Database to utilize previously deleted records?
- How to use a PHP file to control the content of a blog post
- My blog posts section seems to be rendering the other blog posts inside the first? :/
- LinkedIn Share Post Button
- Add another role to a user when they click a button?
- Get the total Author Favorited posts
- wordpress more than one ajax request at the same time issue
- How do I generate formatted permalinks as specified in backend options?
- Changing WordPress author name in database
- Setting at job with shortcode not working
- Display 6 most recent post on homepage?
- Loop 1 user randomly
- Apply filters when loading post via ajax
- How to call post title and post summary to other part of site?
- Published custom posts missing
- How to ‘remember’ a site member’s last visited page?
- How to connect database table to each registered wordpress user.
- Insert wordpress tags below posts via functions.php
- User driven content problems
- Display a list of users with avatar filterable with alphabets
- WordPress article with 50 000 words loading slow – 100% cpu
- link to page_for_posts
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Display post of specific category on page
- Check if username doesn’t exists
- How to create a loop that will display one post and stop?
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- WP query with variables gives no result for specific user
- How to create a WordPress PAGE in another folder?
- How to create custom user role without plugin?
- PHP Works only for logged in users: [closed]
- Custom Admin Menu Report for Specific User ID