How to limit posts by category

bunu kullan $author_posts = new WP_Query( array( ‘cat’ => ‘1,3’, ‘post_type’ => ‘any’, ‘post_status’ => ‘publish’, ‘author’ => $user_id, ‘fields’ => ‘ids’, ‘monthnum’ => date( ‘m’ ), // Whatever the current month is ) );

Limit the menu child levels under “admin > appearance > menus”

Just use remove_submenu_page( $menu_slug, $submenu_slug );. $menu_slug = Parent page $submenu_slug = Submenu page Example usage: // Remove the submenu page for widgets add_action( ‘admin_menu’, ‘adjust_the_wp_menu’, 999 ); function adjust_the_wp_menu() { remove_submenu_page( ‘themes.php’, ‘widgets.php’ ); }

register_post_type name character limit

You cannot change that value. The database schema is limited to 20 Bytes. See wp-admin/includes/schema.php: TABLE $wpdb->posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) unsigned NOT NULL default ‘0’, post_date datetime NOT NULL default ‘0000-00-00 00:00:00’, post_date_gmt datetime NOT NULL default ‘0000-00-00 00:00:00’, post_content longtext NOT NULL, post_title text NOT NULL, post_excerpt text … Read more

Restrict users post for himself

Try this code: (edited code a little) add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); function my_page_template_redirect() { global $post; if( is_user_logged_in() ) { if( is_single() ){ if( $post->post_author != get_current_user_id() ){ wp_redirect( ‘IN ANY PAGE’ ); } } }else{ wp_redirect( ‘IN ANY PAGE’ ); } }

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