Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #435845

    Just saw the tutorial about how to create Child Theme for Enfold. But what I still don’t know is how to override main theme’s php template files in directories like ‘themes/enfold/framework/’ or ‘themes/enfold/includes’?

    Can anyone guide me with that?

    Thanks!

    #436376

    Hi Denis!

    You can copy the actual template files into your child theme to override them, https://codex.wordpress.org/Template_Hierarchy, but that does not include all of the PHP files in Enfold.

    There are other ways to do customizations such as filters or function overrides. What exactly are you trying to do?

    For shortcode files see here, https://kriesi.at/support/topic/is-it-possible-to-modify-files-in-enfold-child/#post-218226.

    Cheers!
    Elliott

    #436512

    Hi Elliott,

    Thanks for your reply, what I am trying to do is to override functions in the following template files.

    themes/enfold/includes/admin/register-widget-area.php
    The avia_dummy_widget function.

    themes/enfold/framework/php/class-sidebar-generator.php
    The register_custom_sidebars function.

    What I want to do it to change the widget title and side bar title html tags from h3 to div or other none heading html elements. I have tried to copy them to the same directories in the child theme, but still no response.

    Is there any way I can get around with this? And I am not very familiar with filters, how can we override functions in class?

    Thanks.

    #437222

    Hi!

    The dummy widgets will only display if you didn’t use any widgets. You don’t have any widgets in the sidebars? You can create your own dummy widget in the functions.php file:

    add_action('ava_add_custom_default_sidebars', 'ava_add_custom_default_sidebars_mod', 10);
    function ava_add_custom_default_sidebars_mod() {
    	avia_custom_dummy_widget(1);
    	avia_custom_dummy_widget(2);
    	avia_custom_dummy_widget(3);
    	avia_custom_dummy_widget(4);
    }
    
    function avia_custom_dummy_widget($number)
    	{
    		switch($number)
    		{
    			case 1:
    			$title = apply_filters('widget_title', __('Interesting links','avia_framework') );
    
    			?>
    				<section class='widget'>
    				<div class='widgettitle'><?php echo $title; ?></div>
    				<span class='minitext'><?php _e('Here are some interesting links for you! Enjoy your stay :)','avia_framework');?></span>
    				</section>
    			<?php
    			break;
    			
    		
    			case 4: 
    				$title = apply_filters('widget_title', __('Archive','avia_framework') );
    			
    				echo "<section class='widget widget_archive'>";
    				echo "<div class='widgettitle'>" . $title . "</div>";
    				echo "<ul>";
    				wp_get_archives('type=monthly');
    				echo "</ul>";
    				echo "<span class='seperator extralight-border'></span></section>";
    			break;
    			
    			case 3: 
    				$title = apply_filters('widget_title', __('Categories','avia_framework') );
    			
    				echo "<section class='widget widget_categories'>";
    				echo "<div class='widgettitle'>" . $title . "</div>";
    				echo "<ul>";
    				wp_list_categories('sort_column=name&optioncount=0&hierarchical=0&title_li=');
    				echo "</ul>";
    				echo "<span class='seperator extralight-border'></span></section>";
    			break;
    			
    			case 2: 
    				$title = apply_filters('widget_title', __('Pages','avia_framework') );
    			
    				echo "<section class='widget widget_pages'>";
    				echo "<div class='widgettitle'>" . $title . "</div>";
    				echo "<ul>";
    				wp_list_pages('title_li=&depth=-1' );
    				echo "</ul>";
    				echo "<span class='seperator extralight-border'></span></section>";
    			break;
    
    		}
    	}

    Remove the default dummy widgets via css.

    Best regards,
    Ismael

    #457440

    i want to overwrite the following file in the child theme:
    \themes\enfold\framework\php\class-form-generator.php

    where should I put it in the child theme?

    thanks.

    #457929

    Hey!

    That’s not a template file so you cannot move it to the child theme. You could try copying the contents of the file and paste it into your child theme functions.php file though. All except the very first line.

    <?php  if (  ! defined( 'AVIA_FW' ) ) exit( 'No direct script access allowed' );
    

    Regards,
    Elliott

    #492542

    hello,

    i would like to ask if using your method mentioned above (copy all the contents of the file and paste in the child theme’s functions.php) will affect load speed or sever resources in any way?

    • This reply was modified 9 years, 3 months ago by adotopanuga.
    #492961

    Hi!

    It’s just moving the class so I highly doubt it.

    Best regards,
    Elliott

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