tag.
*/
do_action('wp_body_open');
}
}
//Enqueue script and style
add_action( 'wp_enqueue_scripts', 'vdperanto_theme_css',999);
function vdperanto_theme_css() {
wp_enqueue_style( 'bootstrap-style', VDPERANTO_PARENT_TEMPLATE_DIR_URI . '/css/bootstrap.css' );
wp_enqueue_style( 'vdperanto-parent-style', VDPERANTO_PARENT_TEMPLATE_DIR_URI . '/style.css' );
wp_enqueue_style( 'vdperanto-child-style', get_stylesheet_uri(), array( 'vdperanto-parent-style' ) );
wp_enqueue_style( 'vdperanto-custom-style-css', VDPERANTO_TEMPLATE_DIR_URI."/css/custom.css" );
wp_dequeue_style( 'busiporf-custom-css', VDPERANTO_PARENT_TEMPLATE_DIR_URI.'/css/custom.css');
//add script
wp_enqueue_script('vdperanto-mp-masonry-js', VDPERANTO_TEMPLATE_DIR_URI . '/js/masonry/mp.mansory.min.js');
}
add_action( 'after_setup_theme', 'vdperanto' );
function vdperanto()
{
load_theme_textdomain( 'vdperanto', VDPERANTO_TEMPLATE_DIR . '/languages' );
require( VDPERANTO_TEMPLATE_DIR . '/functions/customizer/customizer-header-layout.php' );
require( VDPERANTO_TEMPLATE_DIR . '/functions/customizer/customizer-blog-layout.php' );
require( VDPERANTO_TEMPLATE_DIR . '/functions/template-tag.php' );
//About Theme
$theme = wp_get_theme(); // gets the current theme
if ('vdperanto' == $theme->name) {
if (is_admin()) {
require VDPERANTO_TEMPLATE_DIR . '/admin/admin-init.php';
}
}
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
}
add_action( 'after_switch_theme', 'vdperanto_import_busiprof_theme_data_in_busiprof_child_theme' );
/**
* Import theme mods when switching from Busiprof child theme to Busiprof
*/
function vdperanto_import_busiprof_theme_data_in_busiprof_child_theme() {
// Get the name of the previously active theme.
$previous_theme = strtolower( get_option( 'theme_switched' ) );
if ( ! in_array(
$previous_theme, array(
'busiprof',
'vdequator',
'arzine',
'lazyprof',
)
) ) {
return;
}
// Get the theme mods from the previous theme.
$previous_theme_content = get_option( 'theme_mods_' . $previous_theme );
if ( ! empty( $previous_theme_content ) ) {
foreach ( $previous_theme_content as $previous_theme_mod_k => $previous_theme_mod_v ) {
set_theme_mod( $previous_theme_mod_k, $previous_theme_mod_v );
}
}
}
// Add masonry blog layout
add_action('wp_footer', 'vdperanto_custom_script');
function vdperanto_custom_script() {
$vdperanto_options = wp_parse_args(get_option('busiprof_theme_options', array()), vdperanto_default_data());
if ($vdperanto_options['blog_masonry3_layout_setting'] == 'masonry3') {
wp_reset_query();
$col = 4;?>
'default',
'service_blink_effect_layout_setting' => 'default',
'blog_masonry3_layout_setting' => 'default',
'testimonial_center_effect_layout_setting'=>'default',
);
}
else{
$array_new = array(
'header_sticky_layout_setting' => 'sticky',
'service_blink_effect_layout_setting' => 'blink_effect',
'blog_masonry3_layout_setting' => 'masonry3',
'testimonial_center_effect_layout_setting'=>'center_box_effect',
);
}
return array_merge($array_new, $vdperanto_current_options);
}
// Add script for sticky header
add_action('wp_head', 'vdperanto_sticky_header');
function vdperanto_sticky_header() {
$vdperanto_options = wp_parse_args(get_option('busiprof_theme_options', array()), vdperanto_default_data());
if ($vdperanto_options['header_sticky_layout_setting'] == 'sticky') {
?>