The post gets added and published but since you have the meta query and the meta key is not added when you submit the post from frontend, it does not show up. Use the following code which adds the meta data as needed.
if ( isset( $_POST['submitted'] ) ) {
$post_information = array(
'post_title' => wp_strip_all_tags( $_POST['postTitle'] ),
'post_content' => $_POST['postContent'],
'post_type' => 'post',
'post_status' => 'publish'
);
$new_post = wp_insert_post( $post_information );
// Add the post meta
add_post_meta( $new_post, '_wti_like_count', 0, true );
add_post_meta( $new_post, '_wti_unlike_count', 0, true );
add_post_meta( $new_post, '_wti_total_count', 0, true );
}
Related Posts:
- Frontend form with multiple posts
- How to Get All Posts with any post status?
- posts_per_page no limit
- How can i get count from query post
- Check for update vs new post on save_post action
- query_post by title?
- How to avoid infinite loop in save_post callback
- Why query_posts() isn’t marked as deprecated?
- Alternative to query_posts for main loop? [duplicate]
- how to query posts by category and tag?
- Using WP_Query to Query Multiple Categories with Limited Posts Per Category?
- Order by meta value or date?
- How do I query by post format in WordPress 3.1
- Display posts of the last 7 days
- Is there a way to exclude the content from the post variable to save on RAM usage?
- Filtering posts by post meta data
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- Query posts by custom taxonomy ID
- Display/query post formats
- How to query post by user role?
- How to return results of a get_posts() in explicitly defined order
- Issue with wp_insert_post and post_content field error Could not update post in the database
- Help to condense/optimize some working code
- How to set posts per page using WP_Query()
- query_posts exclude a meta key
- How do I create a random post that will last for a day
- Ensuring sticky posts are retrieved first (without using two queries)?
- Determine if more posts are available than was asked for in `query_posts()`?
- Modify main WordPress loop with a parse_query filter
- query_posts() in function makes global $wp_query out of sync?
- Limiting query_posts to 1, regardless of sticky post?
- How to make “sticky” pages (and query by them)
- save_post + insert_post = infinite loop
- Query posts: how to exclude results if post is in multiple categories
- query_posts ->using meta_compare / where meta value is smaller or greater or equals
- Problem with ‘post__not_in’
- How to order posts by descending comment count on taxonomy page?
- Wp_update_post: Infinite loop even with remove_action solution, OOP
- Sort posts alphabetically by custom field value, insert divider between different letters
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- WP 5.8 “Query Loop” block: where to place custom query?
- Sort X categories by last update and show image
- Custom Post Type “Event”: chronological list of recurring events
- Endless loop with wp_insert_post and wp_update_post
- using post__in allow duplicate post id
- Pagination on archive.php page
- WordPress Custom Query
- Best way to load page content in Fancybox popup?
- How can I stop wp_update_post messing up HTML example code?
- How should I intercept the main query and inject custom join / order by / group by criteria
- advice on creating a ‘related posts’ query like the one used on stackexchange
- order post my meta value m/d/y format with year as included value
- Order by meta value, pro first, then free
- Having trouble generating pagination links on custom query
- Check before publishing, if already exist post with current custom field value
- How to create an attachments archive with working pagination?
- _wp_page_template to dynamically use template
- Using dynamic conditions in ‘posts_where’ filter
- Help altering a query to exclude all but standard post format
- List users with the most total posts view
- Schedule Sticky Posts
- Use union/intersection query_posts variables in uri request parameter form?
- query_posts doesn’t order by title
- How to limit search to first letter of title?
- query_posts and pagination, still stuck after much research
- Query posts by taxonomy term name
- Sorting problem with ‘query_posts’ funcion in wordpress. Sort by custom field not working
- Total Count of Posts NOT in Selected Categories?
- Custom query with query_posts doesn’t show post without certain meta_key
- how could I get the pagination as I want to when query posts using get_posts function
- Counter code for paginated category pages in wordpress
- Post Title displaying but not in the wrapped HTML I need
- Author List page: Exclude based on last post date
- WordPress Search Filter Only for Page with Child of Child of Child of Child of Child
- Replace query_posts with pre_get_posts
- wp_insert_posts Fatal error: Maximum function nesting level of ‘100’ reached, aborting!
- How to sort by meta value?
- Set Primary category using the Yoast SEO plugin
- query_posts sort in multiple directions
- Filter query_posts by tag slug on “Tag Archive” page (when tag is 2 or more words)
- pagination in author.php template returns 404 error
- get_post_meta causes database queries
- Problem with single-page for my custom post
- How to ensure that is_search() return false after query_posts
- Warning: urlencode() expects parameter 1 to be string, array given in and not getting the preffered output
- Why does publish_{custom-post-type} fire on update?
- How to modify the query to exclude posts by slug?
- query recent posts from several categories
- Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields
- Returning ACF custom field from publish_post
- Show Posts From Same Category OR Same Tag
- Post count per (day/month/year) since blog began
- Example Query Posts Showing the Latest Post with the Featured Image
- Dynamically excluding current page id
- Why is that gdsr_sort=thumbs (GD start rating plugin) only works with query_posts and not with WP_Query?
- How do i paginate query_posts with numeric pagination?
- Query_posts $query_string
- How to make the list of post and load on same page with sub-pages [closed]
- Automatically insert php function into post $the_content
- Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook