Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1234023

    I’ve searched through here and have found some old threads on this, but the various solutions no longer seem to work. I assume it is simply due to the many changes that have occurred over the years to the core code. As we can set defaults for the sidebar and footer for the various display options, it would be great for the header transparency to also have a modular setting for a user set to default, such as having a transparent header by default. Here is some old code that apparently used to work, but no longer does:

    add_action( 'after_setup_theme', 'enfold_customization_product_switch' );
    function enfold_customization_product_switch(){
    	add_filter('avf_builder_elements', 'avf_builder_elements_mod');
    }
    
    function avf_builder_elements_mod($elements)
    {
    	$counter = 0;
        foreach($elements as $element)
        {
    		if($element['id'] == 'header_transparency')  {
                $elements[$counter]['std'] = 'header_transparent ';
            }
    
            $counter++;
        }
    
    	return $elements;
    }
    #1234676

    FYI…I know I can just go into the file that controls it and set transparent as the default…just looking for an update-proof hook to use. Thanks!

    #1234687

    Hi,
    Sorry for the late reply, I tested your code and it didn’t work for me, then I copied what seems like the same code from the documentation and it is working for me?

    add_action( 'after_setup_theme', 'enfold_customization_product_switch' );
    function enfold_customization_product_switch(){
      add_filter('avf_builder_elements', 'avf_builder_elements_mod');
    }
    
    function avf_builder_elements_mod($elements)
    {
      $counter = 0;
        foreach($elements as $element)
        {
        if($element['id'] == 'header_transparency')  {
                $elements[$counter]['std'] = 'header_transparent';
            }
    
            $counter++;
        }
    
      return $elements;
    }

    Please give this a try.

    Best regards,
    Mike

    #1235012

    Yeah, that code I pasted above was the most recent code example I could find in the forums here and it didn’t work for me….I had to go in and manually mod the core file for that…but I will give it another try.

    #1235705

    Hi,
    Ok 🙂

    Best regards,
    Mike

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.