Why are you using direct SQL query instead of wp_insert_post()
?
I see that you seem to be using non-standard database object. It is hard to guess what goes wrong if you are doing something considerably different from native mechanics.
Related Posts:
- simple wp_insert_post example
- Retrieving and Storing Images Linked from Other Domains on Local Server?
- WP_Query with the “offset” argument
- Stopping People Viewing Draft Posts
- The function can not create a table on MariaDB server
- I want to print a message in post ” After one month from publish date”
- WordPress : using AJAX to get posts & Sidebar Content to an external application
- Specific colours for wordpress author ids
- insert post fails after multiple postings
- Add commentmeta custom field to every published comment with SQL
- Pre_Get_Posts order DESC not registering
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Special Query: Title, Terms, Content – %LIKE%
- Has the table name in SQL for WordPress changed from WP_posts to WPCS_post?
- Running Gutenberg React in Development Mode
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- Custom Search Query
- How do I unlock a post programmatically?
- Export WordPress Posts and Meta Information in CSV format
- Removing fields from the Media Uploader/Gallery
- Managing Images for a WordPress Blog: Picasa or Flickr?
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- How wp_ajax_nopriv since WordPress 3.1
- Set user loggin status?
- redirect product-category to a custom page
- Remove All, Published and Trashed Post Views in Custom Post Type
- custom headers for static home page and posts page
- How to redirect WooCommerce shop URL?
- Best way to implement a thumbnail-based gallery in WordPress?
- Why is my mod_rewrite not working?
- Show posts on a page based on a category and tag(s)
- Any tools for quickly grabbing comments / comment count?
- Custom WP_Query with no posts to output
- How to remove buttons from the WP Editor on the edit post page in the admin area
- Adding Page Attributes and Page Templates to Custom Post Type WP 4.7.3
- WordPress Locale Switching on Accept-Language Header
- syntax highlighting for theme-editor.php?
- How do I call in a category title on a category page in a child theme?
- Include custom JS without child theme
- Prepopulating a specific page template with HTML/CSS
- WordPress media uploader – upload tabs not hiding
- how to convert Html block to dynamic widget?
- Custom Log In Screen – Disable password recovery [duplicate]
- orderby in query_posts
- How to get every custom taxonomy names and urls?
- How to include my own css in post
- Problem with theme activatation
- How to customize feed?
- Two description meta tags All in One SEO WordPress [closed]
- Is there a way to by-pass the pagination function on one custom template?
- Create page as a file in my theme?
- Search URL parameters query [duplicate]
- Change Successful password reset message
- Changing the the_author_posts_link() hover title
- Migrate posts from category and sub-category via SQL
- register_post_type permalink
- How do I hide an article element so only logged out users see it
- How to display page ids as page slug names?
- How to add custom ‘layout’ buttons to wordpress editor?
- How to request container_class from wp_nav_menu
- Replace a ‘Title’ tag with a Custom Field
- Fatal error Call to a member function insert() on a non-object [closed]
- change top banner content on specific page
- Is “get_template_part” hierarchy possible?
- How To Use Custom Tax of a Post Type
- Custom Register Link on Backend Form
- Global theme customization multisite
- How to style bootstrap container in WordPress?
- Redirect to custom post if custom archive page has just one result?
- Change login cookie expiration time?
- Is it possible to make a custom post that adds multiple pages?
- Post filter with multiple checkbox taxonomy terms
- Limit posts per page depending on the size of a div?
- Getting error in sql query
- Altered Media Library URLs
- generate a static copy of the website footer html
- Multi-site customization
- Admin menu disable new/delete page
- Show different pages on site depending on user choice
- Is there a way to limit multi upload in media upload box?
- Custom URL Structure for posts with subcategories
- How to loop through 1 CPT with 2 Taxonomies
- Pulling posts into static site (wordpress as subdirectory)
- Call a duplicate registration form with other url
- 404 for some custom taxonomy not ALL taxonomy
- How to support extra color options for shortcodes?
- retrieve theme custom settings
- WP Customizer – what types of fields is it capable of supporting?
- Add default content to post (for specific category)
- pull custom fields values from wp-database in a nested foreach loop
- Display one post randomly from category on home page
- How to make a template for a specific post of a custom post type?
- Pass query param to custom page
- Custom CSS File wont work on second Page
- How to create a shortcode with HTML code in it and custom parameters/
- Post’s arent displaying
- responsive screen not working [closed]
- Custom Menu (only showing direct cildren) ACF not showing