Forum Replies Created
-
AuthorPosts
-
March 15, 2014 at 2:04 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #238031
Thanks alot for your help. Here are the solutions so far as a summary:
1) Sidebar nested Navigation
In the functions.php:
/* * MYSUBNAVI - Display a subnavigation for pages that is automatically generated, so the users doesnt need to work with widgets */ if(!function_exists('avia_sidebar_menu')) { function avia_sidebar_menu($echo = true) { $sidebar_menu = ""; $subNav = avia_get_option('page_nesting_nav'); $the_id = @get_the_ID(); $args = array(); global $post; if($subNav && $subNav != 'disabled' && !empty($the_id) && is_page()) { $subNav = false; $parent = $post->ID; $sidebar_menu = ""; if (!empty($post->post_parent)) { if(isset($post->ancestors)) $ancestors = $post->ancestors; if(!isset($ancestors)) $ancestors = get_post_ancestors($post->ID); $root = count($ancestors)-1; $parent = $ancestors[$root]; } $args = array('title_li'=>'', 'child_of'=>$parent, 'echo'=>0, 'sort_column'=>'menu_order, post_title'); //enables user to change query args $args = apply_filters('avia_sidebar_menu_args', $args, $post); //hide or show child pages in menu - if the class is set to 'widget_nav_hide_child' the child pages will be hidden $display_child_pages = apply_filters('avia_sidebar_menu_display_child', 'widget_nav_hide_child', $args, $post); $children = wp_list_pages($args); if ($children) { $default_sidebar = false; $parentpage = get_the_title($post->post_parent); $parentpagelink = get_permalink($post->post_parent); $sidebar_menu .= "<div class='widget widget_nav_menu'><h3 class='my-parent-item'><a href="; $sidebar_menu .= $parentpagelink; $sidebar_menu .= ">"; $sidebar_menu .= $parentpage; $sidebar_menu .= "</a></h3><ul class='nested_nav'>"; $sidebar_menu .= $children; $sidebar_menu .= "</ul></div>"; } } $sidebar_menu = apply_filters('avf_sidebar_menu_filter', $sidebar_menu, $args, $post); if($echo == true) { echo $sidebar_menu; } else { return $sidebar_menu; } } }
Here is the CSS I used:
/* NESTED SUBMENU */ .sidebar_left .my-parent-item { padding-left: auto; padding-right: 3px; font-weight: normal; font-color: blue; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 1px 0px 0px #DADADA; } .sidebar_left .nested_nav .current_page_item { padding-left: auto; padding-right: 52px; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.2); background: #f8f8f8; font-size: 16px; } .main_color a:hover, .main_color li a:hover { background: #f8f8f8; padding-left: auto; } .widget_nav_menu a { padding-right: 52px; width: 100%; } .sidebar_left .inner_sidebar { margin-right: 0; }
March 12, 2014 at 4:29 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #236383Thanks, Yigit, that worked perfectly! Why do you only need two lines of CSS code and I’m trying to work with at least seven? :)
The last thing missing was the mega menu thing: the menu items in the mega menu with a entypo icon (through the CSS class kartenicon) are still cascading and the Parent item is having a line break:
Could you please have a look at that? Then I would make a summary of the changes with the soultions for the issues.
CSS for the mega menu item used so far:
/* MAP ICONS instead of bullets in main navigation */ .kartenicon .avia-bullet:before { display: none; } .header_color .kartenicon .avia-bullet { display: none; } .kartenicon:before { content: "\E842"; font-family: 'entypo-fontello'; padding-right: 10px; float: left; } .parent-mm-item .avia-bullet:before { display: none; } .parent-mm-item :before { content: "\E843"; float: left; font-family: 'entypo-fontello'; padding-right: 10px; }
March 11, 2014 at 8:21 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #235827Thanks a lot for your reply, Peter. CSS really is a challenge for me – happy, that you are still with me :)
I used your snippet and it almost worked for the nested menu.
Could someone please have a look at the line under the h3 parent item and the hover of the list item:Here is the code I used so far in the Quick CSS:
/* NESTED SUBMENU */ .sidebar_left .my-parent-item { padding-left: auto; padding-right: 3px; font-weight: normal; font-color: blue; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 1px 0px 0px #DADADA; } .sidebar_left .nested_nav .current_page_item { padding-left: auto; padding-right: 52px; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.2); background: #f8f8f8; font-size: 16px; } .main_color a:hover, .main_color li a:hover { background: #f8f8f8; padding-left: auto; }
March 9, 2014 at 11:55 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #234441This reply has been marked as private.March 9, 2014 at 4:15 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #2343821) I managed to style the nested submenu like the following, but it has a vertical line on the right after the name of the menu item plus it’s not completely working in Firefox – looks better in Chrome and Safari though. I have also given the nested h3 an individual class:
<div class='widget widget_nav_menu'><h3 class='my-parent-item'><a href=";
How do I change it, so that the lin eon the right after the menu item disappears and that it is also good in Firefox? Are the absolute styles for the padding values ok or should I use sth else instead? No idea, if I have styled the right tags …
Here is the CSS:
/* NESTED SUBMENU */ .nested_nav .current_page_item { padding-left: 51px; padding-right: 52px; left: -51px; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.2); background: #f8f8f8; font-size: 16px; } .my-parent-item { padding-left: 164px; padding-right: 152px; font-size: 24px; font-weight: normal; font-color: blue; top: 1px; margin-top: -1px; padding-top: 1px; width: 100%; box-shadow: 0px 1px 1px 0px #DADADA; }
2) Still no solution here for the cascading map icons in the mega menu navigation.
Looking forward to your reply!
March 9, 2014 at 11:48 am in reply to: CSS for nested submenu and for icons as bullets in the menu #234369Hi Ismael,
thanks for your answer – I hope you are doing great, too!
1) I inserted the CSS in the Quick CSS, but unfortunately the CSS does not work for the nested submenu. Nothing has changed so far (and I cleared cache etc.) :(
2) The CSS for the map icons works, but the menu still has old bullets plus is cascading: http://imgur.com/GkLk7rH
Could you please have another look at both issues?
Thanks again!
Daniel
- This reply was modified 10 years, 8 months ago by danaldo.
March 7, 2014 at 8:17 pm in reply to: CSS for nested submenu and for icons as bullets in the menu #233953This reply has been marked as private.Hi Ismael,
worked perfectly!
Thank you all for your kind help!
You can close this one :)
Best,
Daniel
Hi Dude,
thanks for your help – that worked well to reduce the number of post formats displayed in the backend.
How do I have to insert the code for the child theme’s functions.php in order to make adjustments of the post format entypo-fontello icons that can be found in the parent’s theme functions.php (line 154 ff). Or can I simply use CSS to adjust that? If yes – how?
$avia_config['font_icons'] = apply_filters('avf_default_icons', array( //post formats 'standard' => array( 'font' =>'entypo-fontello', 'icon' => 'ue836'), 'audio' => array( 'font' =>'entypo-fontello', 'icon' => 'ue921'), //social 'behance' => array( 'font' =>'entypo-fontello', 'icon' => 'ue915'), 'dribbble' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fe'), 'facebook' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f3'), 'flickr' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8ed'), 'gplus' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f6'), 'linkedin' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fc'), 'instagram' => array( 'font' =>'entypo-fontello', 'icon' => 'ue909'), 'pinterest' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f8'), 'skype' => array( 'font' =>'entypo-fontello', 'icon' => 'ue90d'), 'tumblr' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8fa'), 'twitter' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8f1'), 'vimeo' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8ef'), 'rss' => array( 'font' =>'entypo-fontello', 'icon' => 'ue853'), 'youtube' => array( 'font' =>'entypo-fontello', 'icon' => 'ue921'), 'xing' => array( 'font' =>'entypo-fontello', 'icon' => 'ue923'), 'soundcloud' => array( 'font' =>'entypo-fontello', 'icon' => 'ue913'), 'five_100_px' => array( 'font' =>'entypo-fontello', 'icon' => 'ue91d'), 'mail' => array( 'font' =>'entypo-fontello', 'icon' => 'ue805'), //woocomemrce 'cart' => array( 'font' =>'entypo-fontello', 'icon' => 'ue859'), 'details' => array( 'font' =>'entypo-fontello', 'icon' => 'ue84b'), //bbpress 'supersticky' => array( 'font' =>'entypo-fontello', 'icon' => 'ue808'), 'sticky' => array( 'font' =>'entypo-fontello', 'icon' => 'ue809'), 'one_voice' => array( 'font' =>'entypo-fontello', 'icon' => 'ue83b'), 'multi_voice' => array( 'font' =>'entypo-fontello', 'icon' => 'ue83c'), 'closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue824'), 'sticky_closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue808\ue824'), 'supersticky_closed' => array( 'font' =>'entypo-fontello', 'icon' => 'ue809\ue824'), //navigation, slider & controls 'play' => array( 'font' =>'entypo-fontello', 'icon' => 'ue897'), 'pause' => array( 'font' =>'entypo-fontello', 'icon' => 'ue899'), 'next' => array( 'font' =>'entypo-fontello', 'icon' => 'ue879'), 'prev' => array( 'font' =>'entypo-fontello', 'icon' => 'ue878'), 'next_big' => array( 'font' =>'entypo-fontello', 'icon' => 'ue87d'), 'prev_big' => array( 'font' =>'entypo-fontello', 'icon' => 'ue87c'), 'close' => array( 'font' =>'entypo-fontello', 'icon' => 'ue814'), 'reload' => array( 'font' =>'entypo-fontello', 'icon' => 'ue891'), 'mobile_menu' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8a5'), //image hover overlays 'ov_external' => array( 'font' =>'entypo-fontello', 'icon' => 'ue832'), 'ov_image' => array( 'font' =>'entypo-fontello', 'icon' => 'ue869'), 'ov_video' => array( 'font' =>'entypo-fontello', 'icon' => 'ue897'), //misc 'search' => array( 'font' =>'entypo-fontello', 'icon' => 'ue803'), 'info' => array( 'font' =>'entypo-fontello', 'icon' => 'ue81e'), 'clipboard' => array( 'font' =>'entypo-fontello', 'icon' => 'ue8d1'), 'scrolltop' => array( 'font' =>'entypo-fontello', 'icon' => 'ue876'), ));
Thanks for your support so far!
Daniel
Ha! It works, when I modify the functions.php in the parent theme. But that would make a child theme obsolete. So any ideas how I can still use the child theme?
Do I have to copy the entire parent’s functions.php then to the child’s functions.php?
Hi Devin,
mmh, it didn’t work so far. I am using a child theme. Do I have to do the changes in the parent theme?
What I did (all in the child theme):
I added this to the functions.php, so that i just have audio addded. The default format doesn’t need to be added, I guess./* * add post format options */ add_theme_support( 'post-formats', array( 'audio') );
to the includes>helper-post-format.php:
<?php /* * The loop-index.php file is responsible to display wordpress blog posts * Since this theme supports post formats (different styling and behaviour of certain posts, for example galleries, tweets etc) * the output of the loop-index.php file is filtered before it is passed to the users browser. * * The filtering takes place in the functions defined in this file */ // ========================= default post format ============================ add_filter( 'post-format-standard', 'avia_default_title_filter', 10, 1 ); // ========================= audio post format ========================= add_filter( 'post-format-audio', 'avia_audio_content_filter', 10, 1 ); // ============================================================================================================================= /** * The avia_default_title_filter creates the default title for your posts. * This function is used by most post types */ if(!function_exists('avia_default_title_filter')) { function avia_default_title_filter($current_post) { if(!empty($current_post['title'])) { $heading = is_singular() ? "h1" : "h2"; $output = ""; //$output .= "<{$heading} class='post-title entry-title ". avia_offset_class('meta', false). "'>"; $output .= "<{$heading} class='post-title entry-title' ".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).">"; $output .= " <a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$current_post['title']; $output .= " <span class='post-format-icon minor-meta'></span>"; $output .= " </a>"; $output .= "</{$heading}>"; $current_post['title'] = $output; } return $current_post; } } /** * The avia_audio_content_filter checks if a audio embed is provided and extracts it * If no slideshow is set, it checks if the content holds a video url, removes it and uses it for the slideshow * The filter also sets the height of the slideshow to fullsize, and even on overview posts all slides are displayed */ if(!function_exists('avia_audio_content_filter')) { function avia_audio_content_filter($current_post) { preg_match("!\[audio.+?\]\[\/audio\]!", $current_post['content'], $match_audio); if(!empty($match_audio)) { $current_post['before_content'] = do_shortcode($match_audio[0]); $current_post['content'] = str_replace($match_audio[0], "", $current_post['content']); } return avia_default_title_filter($current_post); } }
But i still see this in the backend:
And all post with different post formats (like gallery) still show up in the blog.Any idea what else to try?
-
AuthorPosts