Tagged: 

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

    Hi
    I would like to use a modified magazine.php under config-templatebuilder > avia-shortcodes in my child theme.
    I created the necessary folders and created put the modified magazine.php in there but it doesn’t take over the parent’s theme magazine.php for some reason?

    Any idea?

    Thanks

    #362102

    Hey website2create!

    Thank you for using our theme.

    You have to tell Enfold to load this file.

    Make sure you have the same directory structrure as in the parent theme.

    In functions.php of the child theme put the following:

    
    //set the child theme folder that contains the modified shortcodes and make sure, it is the first element
    function add_child_shortcode_folder($paths)
    {
        if(! is_array( $paths ) )
        {
    		$paths = array();
        }
    	
    	$child_path = array(dirname(__FILE__) ."/avia-shortcodes/");
            
    	$paths = array_merge($child_path, $paths);
    	return $paths;
    }
    
    add_filter('avia_load_shortcodes','add_child_shortcode_folder', 1000);
    

    Cheers!
    Günter

    #362183

    Hey

    The code you posted didn’t work – one small thing – I had to set:
    $child_path = array(dirname(__FILE__) .”/config-templatebuilder/avia-shortcodes/”);

    instead of
    $child_path = array(dirname(__FILE__) .”/avia-shortcodes/”);

    Now it works

    Thanks!

    #362188

    One more question, if I want to add another path, how I add it?

    #362229

    Hey!

    Thanks for coming back and the feedback.

    Glad you could fix my bug.

    To add another path simply extend the array $child_path and seperate the paths with “,” like:

    
    array(
          dirname(__FILE__) .”/avia-shortcodes/”,
          "path_2",
          "path_3"
         );
    

    Best regards,
    Günter

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