Personalize your theme

Remove Avia Framework debug information

By default the theme’s framework outputs a bit of debugging information into the source code of your site. This is similar to how many caching plugins will show the date of the most recent save and how much time it took to generate the page.

It will look something like this:

Debugging Info for Theme support:  

Theme: Enfold 
Version: 2.4.1 
Installed: enfold 
AviaFramework Version: 1.8.5 
AviaBuilder Version: 0.4 
ML:128-PU:35-PLA:5

If you are using version 4.3 or higher please use the below code in your functions.php file.

if(!function_exists('avia_debugging_info')){
  function avia_debugging_info() {
    // 
  }
}

For Enfold version older than 4.3 please use the below code in your functions.php:

remove_action('wp_head','avia_debugging_info',1000);

Change the Dynamic CSS filename

All of the Styling options you set in the theme’s Styling options are saved to a file in your uploads folder called enfold.css. If you have changed the theme name or something like that you may want to rename this file to better reflect your own branding. You can use the following function to do just that:

add_filter('avf_dynamic_stylesheet_filename', 'avia_change_filename');
function avia_change_filename(){
    return 'custom_name';
}

Note: Once you apply this code remember to re-save you Theme Options to generate the new dynamic CSS file.

Change icon used for standard theme elements

The theme has a set of icons defined for theme elements in the main functions.php file in your theme files. They are the icon codes from the entypo-fontello font file that is included in the theme to show all of the various icons used throughout the theme. They array of named instances and their icon codes start just after:

$avia_config['font_icons'] = apply_filters('avf_default_icons', array(

If you are modifying the main theme you can just change the values for the icon. If you are using a child theme however you can change them through a function.

For example:

add_filter('avf_default_icons','avia_replace_standard_icon', 10, 1);

function avia_replace_standard_icon($icons)
{
$icons['standard'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue915');
return $icons;
}

Remove the Import Dummy Data button

After you’ve set your site up you may want to remove the Import Dummy Data button in the main theme settings.


To remove the “Import Dummy Content” button from the theme options, add this function to your functions.php or child theme’s functions.php:

add_theme_support('avia_disable_dummy_import');

Remove Enfold tab from WP dashboard

You can add following code to bottom of Functions.php file of your child theme in Appearance > Editor to remove Enfold tab from WP dashboard


add_action( 'admin_init', function () {remove_menu_page( 'avia' );}); // Hide Enfold tab in WordPress dashboard

Remove Theme Options and Theme Extensions from WP admin bar

You can add following code to bottom of Functions.php file of your child theme in Appearance > Editor to remove Theme Options and Theme Extensions from WP admin bar


add_action( 'admin_bar_menu', function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'avia' );}, 999 ); // Hide Theme Options in Admin Bar
add_action( 'admin_bar_menu', function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'avia_ext' );}, 999 ); // Hide Theme Extensions in Admin Bar

Custom Templates for Custom Post Types

Starting from WordPress 4.7, custom templates are not limited to the “page” post type.

To enable custom templates on your custom post types, you’ll need to add a Template Post Type file header to your template files as the following:


/*
Template Name: Full-width layout (Rename to appropriate template name)
Template Post Type: post, page, (insert your new CPTs here)
*/

You can read more about this at https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/.