How can I add an area/option for a custom page description?

A simple, easy, and quick way to add your own custom meta box to your Pages is by first installing the Meta Boxes plugin (required). Next, add the following custom code to your functions.php in your child theme: add_filter( ‘rwmb_meta_boxes’, ‘wpse_236870_meta_boxes’ ); function wpse_236870_meta_boxes( $meta_boxes ) { // Add custom meta box in ‘Pages’ $meta_boxes[] … Read more

Let Users Choose Post Categories

First, you will have to add the categories to user profiles. This question has been addressed before. That will give you the possibility to retrieve an array $data with the category ID’ a user is interested in. Now, you will need to turn that array into a list of posts. Depending on where you want … Read more

Limit 1 global comment per minute

Place the following into a custom plugin or into your child theme’s functions file: add_action(“wp_insert_comment”, function() { global $current_user; if ( !$current_user->ID ) return; update_user_meta( $current_user->ID, “se_last_commented”, time() ); }); add_action(“init”, function() { if ( “wp-comments-post.php” == $GLOBALS[‘pagenow’] ) { global $current_user; if ( !$current_user->ID ) return; $last_commented = (int) get_user_meta( $current_user->ID, “se_last_commented”, 1 ); … Read more

Remove class in nav_menu_link_attibutes filter

Let us first look at this part: I don’t exactly understand what object $item is and this is probably the problem. When I call get_class() on $item I get WP_Post, but WP_Post does not have a classes property. So how is $item->classes returning an array of classes? Few notes regarding the structure of menus in … Read more