• Resolved eugenealegiojo

    (@eugenealegiojo)


    Hi,

    I just created a custom insert query, see below:

    $query = "INSERT $wpdb->posts SET
    					post_title='{$page['post_title']}',
    					post_name='{$page['post_name']}',
    					post_content='{$page['post_content']}',
    					post_parent='{$page['post_parent']}',
    					post_author='{$page['post_author']}',
    					post_status='publish',
    					post_type='page',
    					post_date=now(),
    					post_date_gmt=utc_timestamp(),
    					post_modified=now(),
    					post_modified_gmt=utc_timestamp(),
    					comment_status='closed',
    					ping_status='closed',
    					post_excerpt='',
    					to_ping='',
    					pinged='',
    					post_content_filtered='',
    					menu_order=0";
    		$wpdb->query( $query );

    It’s inserted successfully to wp_posts table but when I browse the link in the front end, it keeps telling ‘Page not found’.
    I had checked the table wp_posts and it is there. Not sure what’s going on.

    Anyone encountered the same problem? Really need your idea guys.

    Thanks in advance.
    Eugene

  • The topic ‘Inserted page not found!’ is closed to new replies.