If you’re trying to get a post with the id of 32, the parameter you would use is p
, which is one of the Post & Page Parameters. tag_id
is used for querying posts with a particular Tag ID.
$args = array(
'post_type' => 'post',
'p' => 32
);
$fp_post = new WP_Query( $args );
if ( $fp_post->have_posts() ) :
while ( $fp_post->have_posts() ) : $fp_post->the_post();
the_content();
endwhile;
else:
echo 'it is not working';
endif;
Related Posts:
- WP_Query for WooCommerce Products
- How can I display recent posts from a particular category in my header?
- Using AJAX to return search form results
- Pagination is not working using WP_Query
- Two queries on the same page with pagination
- Array Chunks and Inserting Varying HTML in WP_Query
- Why is this coming back as null? Thats wrong. There is one post
- How to display future posts – modified query still yields 404
- WP_Query arguments to fetch custom post type posts which are in certain category?
- Which method is faster to get a single post?
- Import wp users via one click demo option
- How can I use $wp_query->tax_query as tax_query parameter for a new WP_Query instatiation?
- Adding column to wp_posts table or join wp_posts table with another table
- Two loops on archive page
- Check if loop has any categories?
- How to make search for posts using get method?
- Multiple filter conditions for WP_Query
- Reset WordPress Post Query to default
- What happens to the default query when I use WP_Query?
- How to Create a Random List of Child Pages
- Wp_query with 2 meta keys and array of meta values
- Problem with get_page_by_path() using with WP_Query
- WP_QUERY wrong ammount of posts
- How to create Page templates for showing Blog posts in different layouts?
- Writing less unnecessary code with WordPress
- How to separate two columns from one content on a page template?
- Using Ajax and WP_Query to load more posts on category page fails
- WooCommerce | AJAX | Product Pagination | Help me implement Ajax Pagination
- Custom WordPress post query for displaying time-released content on website
- How to display author meta and count numbers for each user in comment.php?
- Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?
- Global page ID variable empty error
- Get posts by similar names and categories
- Second WP_Query loop shows data from main query
- active link for most recent post on vertical tabs
- Custom Theme Building & Permalinks
- WP_Query issues with argument posts_per_page
- Get author meta data with no published posts in author.php?
- How to display posts from a specific term first then another posts from another terms using tax_query
- Why ignore_sticky_posts argument is in sticky post query?
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Wp_redirect and sending variables
- How do I get posts that have a thumbnail in WP_Query?
- WP_Query – filter or directly?
- WP_Query with checkbox meta_query
- IP address character limit
- How can I save an array from a random post sequence for later use?
- Does WordPress generate an automatic page for post formats?
- Why is WP-Query spelled like it is?
- How to add custom query filters in WP_User_Query
- How to order category.php loop by ‘meta_value’?
- Searching user meta using WP_User_Query
- Which custom query am I in and how can I access its properties & methods?
- Pagination not working Search posts
- Does using a custom query_var create a security hole?
- Why I can’t get old posts instead of recent with WP_Query?
- How get posts from a subcategory of a category by name?
- Date query not inclusive despite parameter being true
- Change default ordering of taxonomy terms – pre_get_terms
- Exclude old events from WP_Query with date saved in a `meta_key`
- WP_Query loop within WP_Query loop
- current_post not working – give me -1 for every post
- How to fetch only media that was already attached to a post/page?
- WP_Query won’t retrieve raw HTML?
- Remove a specific category ID from related post
- Order posts by taxonomy count
- WP_QUERY to display woocommerce products whose author IS the logged in user
- Understanding the orderby in WP_Query?
- Need Help For WPQuery
- When variable value have space between word, doesnt show any result WP_Query
- Posts published last 10 minutes
- Getting additional columns from sql
- get all posts associated with a custom taxonomy
- WordPress query posts with multiple post_meta data
- Assign custom parameter to each post in query
- complex get_posts() query to select child pages
- How to add $args to any running wp_query from function.php?
- Get next/prev image/attachment in time with date query
- WP_Query not getting all posts, just tagged posts
- How to add a recent post function to a text widget I created for practice?
- Can I make a search query which includes a space?
- WP_Query – display posts by custom field and order by another
- WP_Query no result if keyword contains number
- WP_QUERY order posts by two combined meta_value dates
- Order by value of Custom Field using url string
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- WP_Query returns empty if meta_query has more than 7 values
- query.php – multiple is_category functions
- Custom query with post_class filter using current_post not working
- Overwriting auto-appended NOT IN query in WP_Query
- posts_per_page not returning correct number of posts
- query_posts with sorting on a custom datestamp
- Conditionals in WP_Query
- Why WP_Query in functions.php is not working when get_posts works?
- Next / previous posts link doesn’t show up with Posts 2 Posts
- query by meta value then date and not empty meta value
- Issue with sorting by post date and custom post type
- Can’t get LIKE to work with wp_query [closed]
- List categories using WP_Query
- WP Query – Show custom posts only if user contain some user meta