Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #229254

    I have 3 theme hacks that I have to update every time you update, perhaps you guys can easily point me in the right direction with them? The first hack adds title tag to the logo- for whatever reason the theme does not add it correctly.

    Theme/framework/php/function-set-avia-frontend.php
    Line 426 to:

    
    		if($logo = avia_get_option('logo'))
    		{
    			 $logo = "<img src='{$logo}' alt='{$alt}' title='{$alt}'/>";
    			 $logo = "<$headline_type class='logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    		}
    		else
    		{
    			$logo = get_bloginfo('name');
    			if($use_image) $logo = "<img src='{$use_image}' alt='{$alt}' title='{$alt}'/>";
    			$logo = "<$headline_type class='logo bg-logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    		}
    

    I manually added in title='{$alt}’ in both statements to get the title to work.

    The second hack is to add text to the cart button, and to hide it with a CSS indent.

    Edit config.php in enfold\config-woocommerce\config.php
    Line 758

    
    $output .= "<a class='cart_dropdown_link' href='".$link."'><span ".av_icon_string('cart')."><span class='hide'>Cart</span></span></a><!--<span class='cart_subtotal'>".$cart_subtotal."</span>-->";
    

    The hide class has my indent/hide code on it.

    The last hack is to add customability for visibility to theme menu’s, which I found in your forum here.

    Add code to enfold/functions.php
    add_theme_support(‘avia_conditionals_for_mega_menu’);
    On line 17
    Under
    if(isset($avia_config[‘use_child_theme_functions_only’])) return;

    Reference: From <https://kriesi.at/support/topic/enfold-conditional-menu/&gt;

    Is there any way to bring this into the child theme functions.php so I can stop hacking the theme?

    Thank you guys so much for the help!

    #229855

    Hi Imburr!

    Anything that has if(!function_exists('avia_logo')) preceding the start of the function can be replaced by a child theme. You would need to re-do the setup of the function.

    The title attribute however I don’t view as needed on a logo. The alt text telling screen readers and the like saying that this is ‘site name’ but the title tends to just aggrivate users since it appears as a tooltip for users who can already plainly see a logo with the identical information.

    For #2, you can remove the theme function and then add your own function, something like:
    remove_action( 'ava_main_header' , 'avia_woocommerce_cart_dropdown', 10)
    then you would duplicate that same function and then add it back in the same way its added in that file (but all in your functions.php file).

    #3 you add the same thing your child functions.php.

    Best regards,
    Devin

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Convert Theme Hacks to Child- Title tag on Logo, Text to Cart, Conditional Menu’ is closed to new replies.