Sofian777
Forum Replies Created
-
Forum: Plugins
In reply to: [Easy Timer] Removing "hours" "minutes" "seconds" textDear Kleor,
thank you for fast reply. Works perfect like this.
One more question: I would like that the digits stay 2digits, i mean i would like to have 9 as 09, so it stays 00:09:03 for example, instead of 9:3. Can this be changed as well in the code easily?
Forum: Themes and Templates
In reply to: [Twenty Twelve] Adding parent class to menu itemThanks for this, i tried it out but i couldnt get it to work. I copied it into my functions.php like this, is there anything else i should have done? (creating the childtheme i have done right since the css also worked. the file is named correctly, so i cannot find where i made my newbie mistake:)
<?php add_filter( 'wp_nav_menu_objects', 'add_menu_parent_class' ); function add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item ) { if ( in_array( $item->ID, $parents ) ) { $item->classes[] = 'menu-parent-item'; } } return $items; } ?>
Forum: Themes and Templates
In reply to: [Twenty Twelve] Adding parent class to menu itemHello Paul,
thanks for reply, the second one is indeed a solution that works. Yet i would like to avoid using the custom menu and keep it automated, so the search continues for a solution to make WP itself add a class to all menu items that have children, as some themes are doing it (graphene or the elegantthemes.com themes).
Actually this should have been solved multiple times and i found some posts and descriptions in the net, but i couldnt find a clear outcome there and my programming knowledge keeps me in need of a step-by-step explanation (i can add a function but i cannot program it by myself).
Any further ideas?