Adding Meta Box to Specific Submenu Page

I think for this you want to go with WordPress Setting API. If you prefer meta box. You have to add a do_action in your function which render the page (view_tasks_submenu_page_callback). do_action( ‘add_meta_boxes’, $hook_id ); And add do_meta_boxes($hook_id, $context, null) where you want your meta boxes appear. replace $hook_id by the fourth parameter of add_meta_box … Read more

Meta box not saving

Since you are using single values anyway, how about trying just: $meta_SDate = get_post_meta($post->ID,’event_start_date’,true); $meta_EDate = get_post_meta($post->ID,’event_end_date’,true); Also note the following lines will need a space to separate the posted values so strtotime can work properly: $updStartD = strtotime(trim($_POST[‘event_start_date’]) . ‘ ‘ . trim($_POST[‘event_start_time’])); $updEndD = strtotime(trim($_POST[‘event_end_date’]) . ‘ ‘ . trim($_POST[‘event_end_time’])); I have added … Read more

display post multiple times based on array of dates

I don’t know what rwmb_meta() does. But if rwmb_meta(‘tbf_scheduledatetime’) returns array, then try something like this: … $images = rwmb_meta( ‘tbf_scheduleimage’, ‘type=image&size=full’); $dates = rwmb_meta(‘tbf_scheduledatetime’); var_dump( $dates ); … You’ll probably want to loop thru $dates and repeat the post data for each element in $dates.

after checked the checkbox in backend, dont show social link on frontend

It cannot be in post metabox, because it is site setting, not specific page. You can create submenu position for settings in your admin panel by add_submenu_page function, for example: add_action(‘admin_menu’, ‘add_my_settings_submenu_page’); function add_my_settings_submenu_page() { add_submenu_page(‘options-general.php’, ‘Page title’, ‘Menu title’, ‘manage_options’, ‘my_settings’, ‘my_settings_submenu_callback’); } Then you need to create callback for last argument where will … Read more

Metabox value for post loop?

Thanks guys.I did it with WP_Meta_Query (https://codex.wordpress.org/Class_Reference/WP_Meta_Query) Solution: <?php $query = new WP_Query( array( ‘meta_key’ => ‘j4cob_yaz_ayarlar_show_on_slider_’, ‘meta_value’ => ‘show-on-slider’, ‘posts_per_page’ => 6 ) ); ?> <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> . Loop . <?php endwhile; wp_reset_postdata(); else : ?> <p><?php _e( ‘Sorry, no posts matched your … Read more

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