Tagged: child theme
-
AuthorPosts
-
April 28, 2015 at 8:24 am #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!
April 28, 2015 at 9:11 pm #436376Hi 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!
ElliottApril 29, 2015 at 7:12 am #436512Hi 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.
April 30, 2015 at 8:20 am #437222Hi!
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,
IsmaelJune 10, 2015 at 6:08 pm #457440i want to overwrite the following file in the child theme:
\themes\enfold\framework\php\class-form-generator.phpwhere should I put it in the child theme?
thanks.
June 11, 2015 at 5:35 pm #457929Hey!
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,
ElliottAugust 24, 2015 at 11:55 pm #492542hello,
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, 4 months ago by adotopanuga.
August 25, 2015 at 3:09 pm #492961Hi!
It’s just moving the class so I highly doubt it.
Best regards,
Elliott -
AuthorPosts
- You must be logged in to reply to this topic.