How to checked selected category checkbox when my custom post inserted from frontend

// set Selected Post CATEGORY cheked wp_set_object_terms( $post_id, array((int)$_POST[‘movies_cat’]), ‘movies’ ); } else{ die(“check seccurity”);} // This bellow given code add on design page <p class=”meta-options hcf_field”> <label for=”movies”>The Categories</label> <?php wp_dropdown_categories( ‘taxonomy=movies&name=movies_cat&show_option_all=Select a category’ ); ?> </p>

How to save post with different languages and linked them with WPML?

Thank @Sally CJ I made the solution : main code global $sitepress_settings; //Insert post with main lang $post = $binding_main_cpt[‘post’]; $default_language = $sitepress_settings[‘default_language’]; $main_post = $post[$default_language]; $postInformation = [ ‘post_title’ => wp_strip_all_tags(trim($main_post[‘post_title’] ) ), ‘post_content’ => $main_post[‘post_content’], ‘post_type’ => $main_post_type, ‘post_status’ => ‘publish’ ]; $master_post_id = wp_insert_post($postInformation); echo sprintf( “insert post %d”, $master_post_id ); foreach($sitepress_settings[‘active_languages’] … Read more

wp_insert_post if page doesn’t exist under current page

$args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => -1, ‘post_parent’ => $post->ID, ); $children= new WP_Query( $args ); $seasonepisode = array( ‘post_title’ => $episodetitle, ‘post_content’ => ‘Some Content’, ‘post_status’ => ‘publish’, ‘post_parent’ => $post->ID, ‘post_type’ => ‘page’, ‘page_template’ => ‘template-songlist.php’ ); if ( $children->have_posts() ){ while ( $children->have_posts() ) { $children->the_post(); if(get_the_title() != $episodetitle){ wp_insert_post($seasonepisode); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)