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?
- How to store page visit counts?
- Problem with custom user meta field
- What are “best practices” for wp-config.php
- Instant install of wordpress
- Problem with theme activatation
- How to customize feed?
- Add content in between of foreach
- User bar above logotipo?
- How to solve this problem with my subdomain?
- Create a url structure for my blogs based on categories and sub-cats
- How to insert a writing panel between the title and the page content?
- Two description meta tags All in One SEO WordPress [closed]
- Looking replicate static HTML Menu into WordPress Dynamic Menu [closed]
- Add a searchbox to the body of a page
- Best way to allow overwriting images shipped with the plugin?
- Switch between WordPress websites easy for an end user
- Is there a way to by-pass the pagination function on one custom template?
- I’d like to be able to programatically setup a site to discourage crawling by search engines
- CSS Styling a specific page
- Where in code to replace content before display of page?
- Removing blank space below header [closed]
- Page content dissapears after loading the page [closed]
- Is there a way to add a new value into a stored custom field value?
- How to remove footer from just homepage
- Is it possible to customize the post according to post format in single.php?
- Customize rel=canonical tag for single blog post
- Custom Search on Custom Page while preserving the main search function
- Create small dashboard widget
- How to define custom links in WordPress
- Is there a way to override require_once of the main theme on the child theme?
- Why the css in twenteenfourteen-child theme take no effect?
- Custom Loop Query For Search Page
- Make RSS feed only accesible by Mailchimp
- WordPress website loads more posts than expected
- spaces in a text
- Custom font size nav bar
- How can I add interactive python console to my website? [closed]
- Display specific Taxonomy Term from Custom Post Type
- Show “Read more” link only when inserted manually
- a little direction on custom post type
- SQL Command for restoring trashed comments
- Changer numbers of columns in woocommerce shop
- disable Tab post on nav-menus page (Admin)
- Load File (Function & Variable Value) from Child Theme
- Woocommerce product permalink not working
- website with pretty permalinks except pagination
- Basic Authentication problem with custom API endpoints
- How to create a control for css opacity in the Customizer
- Can I integrate wordpress with my current website so I can utilize the wordpress plugins?
- How to put a site offline, including images?
- Show custom message/info for authors in add/edit post page
- How to add css option to Header Image customizer?
- Create page as a file in my theme?
- Moving wp-content folder
- Modify the display Text of number of comments
- How can I start over on my site? [closed]
- Static Front Page settings – distinguish between Front page and Post page
- Modify files without losing customization after updates
- Plugin to allow registered users to customize their layout [closed]
- Changes in my child theme from customizer not appearing in style.css?
- How to format text of site subtitle
- Toggle custom fields?
- dbDelta not creating tables with composite keys
- Determine if action was executed in functions
- Widgets won’t save
- Format latest/newest post differently
- Lost password and back to blog in same line
- Custom taxonomy archive page problem
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Tell WP to use a specific template file in posts
- Can Username and Password be passed to WP Login page in an IFrame?
- Returning or use form data using a hook?
- Customizing Users in Admin Area
- wp_customize set_transient except during preview
- Default Display Name As Username
- NextGEN Gallery – open all images on page in fancybox [closed]
- Is it advisable to use `add_rewrite_rule()` to serve a custom page?
- How to stop displaying the Id without losing the functionality
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Customizing the Widget content markup
- WP custom routing does not work
- relating business and products with custom taxonomy?
- How to do big modifications to live site?
- create Custom field for tv series
- Widget title markup in register_sidebar
- Data won’t save if metabox within conditional in admin. What am I missing?