Make post_content and other custom fields required

Don’t rely entirely on JavaScript validations. Use below hook for Server side validation. function check_if_post_content_set( $maybe_empty, $postarr ) { // Check if post is already created. IMPORTANT if($postarr[‘ID’] && (int)$postarr[‘ID’] > 0){ if( !$postarr[‘post_content’] OR $postarr[‘post_content’] == ” OR $postarr[‘post_content’] == NULL ){ $maybe_empty = true; } } return $maybe_empty; } add_filter( ‘wp_insert_post_empty_content’, ‘check_if_post_content_set’, 999999, … Read more

wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu

Please use below code in your theme funcation.php file function my_asc_nav_menu($menu, $args) { if (isset($args->reverse) && $args->reverse) { return array_reverse($menu); } return $menu; } add_filter(‘wp_nav_menu_objects’, ‘my_asc_nav_menu’, 10, 2); And also use your wp_nav_menu function as below: wp_nav_menu(array( ‘theme_location’ => ‘primary’, ‘container’ => ‘ul’, ‘menu_class’=> ‘top-menu’, ‘reverse’ => FALSE, ) );

How to output images as figure/figcaption

add_theme_support( ‘html5’, array( ‘gallery’ ) ); or with another arguments such as search-form, comment-form, comment-list and caption, its call as Theme Markup Added gallery and caption support was introduced since WordPress version 3.9. As of version 3.9 WordPress uses <figure> and <figcaption> elements, instead of the generic definition list markup to output galleries. More on … Read more