Number of items in a menu

I was curious and decided to check it out, regardless if it’s relevant for a CSS problem 😉 I first peeked into the database tables to find more about the menu structure: Menu – building blocks Each navigational menu is registered as a term in the nav_menu taxonomy. Then when we add items to that … Read more

How to get a category in a list item class

The first issue I’m seeing is that you’re trying to use the_category as a class. This won’t work as this function is intended to output the links to the categories assigned to that post. So it’s putting the href inside your class. You can debug and see how it works by removing your li and … Read more

Listing all sub-pages?

easy just pass it the $id off which to get the children global $id; wp_list_pages(“title_li=&child_of=$id”); of if you want in the loop then wp_list_pages(“title_li=&child_of=$post->ID”);

Exclude a category from the filed under list only on some templates

You can add conditional statements before applying the logic to modify the categories. For example, I added a check that will bail and return the unmodified list of categories if we’re not on the category archive page: // Add the filter to ‘the_category’ tag. add_filter( ‘the_category’, ‘the_category_filter’, 10, 2 ); function the_category_filter( $thelist, $separator=” ” … Read more

Change default screen option value for posts per page

Just an addiction to @KrzysiekDróżdż answer. When viewing a specific post status the url query string variable ‘post_status’, is set to the name of the status, so you can use $_GET[‘post_status’] to narrow the effect of @KrzysiekDróżdż code only for pending posts: function my_edit_per_page( $result, $option, $user ) { $status = filter_input( INPUT_GET, ‘post_status’, FILTER_SANITIZE_STRING … Read more

Add class to all list items of wp_nav_menu

There is a nav_menu_css_class filter. It is trivial to add classes. function add_classes_wpse_130358($classes, $item, $args) { $classes[] = ‘new-class’; return $classes; } add_filter(‘nav_menu_css_class’,’add_classes_wpse_130358′,1,3); But you will probably need to extend Walker_Nav_Menu or use the walker_nav_menu_start_el filter instead, since the nav_menu_css_class filter mysteriously does not have access to the depth variable. But walker_nav_menu_start_el doesn’t let you … Read more

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