Tagged: remove menu arrows
remove menu arrows
-
CreatorTopic
-
April 30, 2014 at 8:04 pm #16624
vtheme
ParticipantI wanted to remove the menu down and right arrows, and did so with this customization:
/* remove nav menu arrows down and sideways */
ul.sf-menu-with-fontawesome .sf-sub-indicator {
display: none;
}The problem is that I see them at the load of every page briefly anyway. This looks jumpy and because my menu string is wide, it shows 2 rows of menus with arrows for a second or so and then loads the page properly.
Is there a way to avoid this first load?
-
CreatorTopic
-
AuthorReplies
-
April 30, 2014 at 8:54 pm #16627
Jason Bobich
KeymasterHello,
Can I see a link to what you’ve got going on?
May 1, 2014 at 12:08 am #16631vtheme
Participantcan I send this link privately?
May 1, 2014 at 3:05 am #16634Jason Bobich
KeymasterYes, go to My Account > Submit private info here on the support site. Make sure to post here after you’ve sent the info.
May 1, 2014 at 5:45 am #16637vtheme
ParticipantThanks, sent the url.
(While you are there, can you tell me how to get the “Login” (upper right) link in the header area without using the absolute placement? It was fine using relative addressing on the old versions of the theme, but the code had to be modified when the version changed and the responsive ability is not good here. I’d use the space where the “News” is below the social icons, but that is dictated by the simple line in the Theme Options and won’t work for this login/logout code. Perhaps there is a hook/filter now I am unaware of? )
May 1, 2014 at 10:44 pm #16650Jason Bobich
KeymasterYou officially have passed my secret test. You are one of the 10% to actually put the URL to the support topic in the “Support Topic URL” field when submitting the info.
==========
Ok, let’s try this for your menu icon dilemma. I’m curious to know if it works or not; so let me know. Put this in your child theme’s functions.php.
remove_filter( 'walker_nav_menu_start_el', 'themeblvd_nav_menu_start_el' );
I also noticed you’re using the “custom.css” file in your child theme, which tells me at some point you updated from an older version of Alyeska. In your child theme, make sure your functions.php is setup like this at the top:
https://github.com/themeblvd/Child-Themes/blob/master/alyeska-child/functions.php
… This way you can simply place filters and action hooks after the framework is included, to avoid complications.
And it’s not really important, but you can move all of your custom CSS to style.css of the child theme now, and avoid the “custom.css” file all together, if you want.
==========
Forgive me if I’m not totally understanding what you’re wanting, but if you’d like to retain the formatting of the placement of the Header Text option, with your custom code (which is positioned absolute, by the way) one solution might be to use “alyeska_header_addon” function as a starting point to create your own callback for “themeblvd_header_addon” — By copying the current markup structure, the CSS of the theme will place it for you.
function my_header_addon() { ?> <div class="header-addon header-addon-with-text"> <div class="header-text"> <?php // Your custom code ... ?> </div><!-- .header-text (end) --> </div><!-- .header-addon (end) --> <?php } remove_action( 'themeblvd_header_addon', 'alyeska_header_addon' ); add_action( 'themeblvd_header_addon', 'my_header_addon' );
http://dev.themeblvd.com/tutorial/actions/
http://dev.themeblvd.com/tutorial/primary-framework-action-hooks/
May 2, 2014 at 12:19 am #16656vtheme
ParticipantThanks for all of this.
1. Yes, it worked 🙂 Thank you, it also gives a lot crisper response on the reload.
2. Mine looks essentially the same, but correct me if this is no longer the best practice:
in the top of my functions, I have
require_once ( TEMPLATEPATH . ‘/framework/themeblvd.php’ );instead of :
require_once( get_template_directory() . ‘/framework/themeblvd.php’ );3. I am using a add_action( ‘themeblvd_header_addon’,xxx) but without the
<div class="header-addon header-addon-with-text">
<div class="header-text">… and when I added those in…….yep! – that worked too.
Thanks a ton!
Ok, one last question I’ve come across….
In the old versions, we could modify core functions by placing them in our child functions.php and making adjustments there. The theme used a if !(core_function_name) { do the core function }, so this was possible to do and override them.But in the new theme framework, there is no conditional check in the core function files, so modifications are not possible this way. However, is there a way to adjust the core functions in the child theme?
For example, I had added an attribute to the old toggle function for noborders, but upon updating, it received a fatal error, so I took it out completely.
….that should be the last lingering question I had for the moment….
May 2, 2014 at 7:28 pm #16668Jason Bobich
KeymasterWhat you’re referring to are called pluggable functions. I removed many of the pluggable nature of functions based on how I was seeing many people use them. I talk about it a little in the update article for going to Alyeska 3.0:
http://support.themeblvd.com/updating-to-framework-v2-3/ (See #5 under “Developers” section)
There are essentially three ways to edit a function:
1. Actions: An action executes at a certain time; so you can control what happens at that execution point.
2. Filters: If a piece of data or output has a filter on it, you can modify it.
3. Pluggable function: A last resort, if no way to edit something, you can utilize a pluggable function by copying the entire thing.I have found that people are using pluggable functions because they don’t understand actions and filters, which is very important to understand. Only use pluggable functions as a last resort. If you’re copying an entire function to your child theme to edit it, this is going to leave with you more of a mess as things start to pile up, and leave you at a higher risk of something breaking with updates later on.
So, if a function returns something, and it has a filter on what’s being returned, understand what’s being filtering and use the filter. There’s no need for it to be pluggable.
The snippet above I gave you with themeblvd_header_addon action is good example, where you could have used a pluggable function by copying “alyeska_header_addon” function to your child theme to edit. But instead, I had you unhook alyeska_header_addon, and create your own function.
May 2, 2014 at 7:37 pm #16671Jason Bobich
KeymasterFor example, I had added an attribute to the old toggle function for noborders, but upon updating, it received a fatal error, so I took it out completely.
The framework doesn’t actually have a toggle function. I think maybe you’re referring to the shortcode output that is now in the shortcodes plugin, which would make it not possible for the function to be pluggable anyway.
But actually when you add a shortcode in WordPress, it is technically another form of an “action hook” — but with
add_shortcode()
andremove_shortcode()
.So, for example:
/** * Your modified version themeblvd_shortcode_toggle() */ function my_shortcode_toggle() { // Your custom version of the function... } /** * Function actually modify any shortcode hooks. */ function my_shortcodes() { remove_shortcode( 'toggle' ); add_shortcode( 'toggle', 'my_shortcode_toggle' ); } add_action( 'after_setup_theme', 'my_shortcodes', 11 ) // Priority 11 after shortcodes plugin hooks in;
But if you’re just trying to make a toggle have no border, I’m not sure why you wouldn’t do this with CSS?
May 2, 2014 at 9:29 pm #16685vtheme
ParticipantThanks for all of the explanation – I can make that work.
The reason we didn’t do it with just css, is that we wanted a shortcode with a few more options that could be called upon when needed in a simple manner.
Thanks again for the help!
-
AuthorReplies
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.