/home/desid573/verdenaturopathy.com.au/site3/wp-content/themes/Ellen_Theme
Edit: /home/desid573/verdenaturopathy.com.au/site3/wp-content/themes/Ellen_Theme/functions.php (8745B)
$divi_trigger_popup,
'lovely_readmore' => $divi_lovely_read_more_button_text,
));
}
add_action( 'wp_enqueue_scripts', 'lovely_settings' );
// Video PopUp
function popup_enqueue_scripts(){
wp_enqueue_script( 'magnific-popup', ET_BUILDER_URI . '/feature/dynamic-assets/assets/js/magnific-popup.js', array( 'jquery' ), '1.3.0', true );
wp_enqueue_style('et_jquery_magnific_popup', ET_BUILDER_URI . "/feature/dynamic-assets/assets/css/magnific_popup.css", [], '1.3.0');
}
add_action('wp_enqueue_scripts', 'popup_enqueue_scripts', 20);
// Add Dashboard Scripts & styles
function lovely_enqueue_admin() {
wp_enqueue_style('lovely-custom-admin', get_stylesheet_directory_uri().'/css/admin_lovely_custom.css');
$lovely_values = array(
//'divi_footer_layout' => et_get_option('divi_footer_layout'),
//'divi_404_page' => et_get_option('divi_404_page'),
'divi_popup_library_item' => et_get_option('divi_popup_library_item')
);
wp_enqueue_script( 'lovely-admin-js', get_stylesheet_directory_uri() . '/js/lovely_admin.js', array( 'jquery' ), '', true );
wp_localize_script( 'lovely-admin-js', 'lovely_values', $lovely_values);
}
add_action('admin_enqueue_scripts', 'lovely_enqueue_admin', 999);
// Include TGM plugin activation
require_once dirname( __FILE__ ) . '/lib/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'lovely_register_required_plugins' );
function lovely_register_required_plugins() {
$plugins = array(
array(
'name' => 'One Click Demo Import',
'slug' => 'one-click-demo-import',
'required' => true,
),
);
$config = array(
'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'parent_slug' => 'themes.php', // Parent menu slug.
'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => true, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
tgmpa( $plugins, $config );
}
//* Updater
require 'update/plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'https://lovelyconfetti.com/demos/updates/ellen/theme.json',
__FILE__, //Full path to the main plugin file or functions.php.
'unique-plugin-or-theme-slug'
);
// Remove default Widgets
function ocdi_before_widgets_import( $selected_import ) {
global $wp_registered_sidebars;
$widgets = get_option('sidebars_widgets');
foreach ($wp_registered_sidebars as $sidebar => $value) {
unset($widgets[$sidebar]);
}
update_option('sidebars_widgets',$widgets);
}
add_action( 'pt-ocdi/before_widgets_import', 'ocdi_before_widgets_import' );
//Import demo content
function ocdi_import_files() {
return array(
array(
'import_file_name' => 'Demo Import',
'import_file_url' => 'https://lovelyconfetti.com/demo_import/Ellen/ellen-demo-content.xml',
'import_customizer_file_url' => 'https://lovelyconfetti.com/demo_import/Ellen/ellen-customizer.dat',
'import_notice' => __('Your new website is almost ready - Click Import & have fun!', 'your-textdomain') ,
) ,
);
}
add_filter( 'pt-ocdi/import_files', 'ocdi_import_files' );
add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
// After import...
function ocdi_after_import_setup() {
// Asign Menus
$main_menu = get_term_by('name', 'Main Menu', 'nav_menu');
$top_menu = get_term_by('name', 'Top Menu', 'nav_menu');
set_theme_mod('nav_menu_locations', array(
'primary-menu' => $main_menu->term_id,
'secondary-menu' => $top_menu->term_id
));
// Set Front Page from Reading Options
$front_page_id = get_page_by_title('Homepage');
// Set Blog Page from Reading Options
//$blog_page_id = get_page_by_title('Blog');
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
//update_option( 'page_for_posts', $blog_page_id->ID );
// Set default values/layouts in Theme Options
//et_update_option( 'divi_404_page', 220528 );
et_update_option( 'divi_lovely_preloader_option' , 'on' );
//et_update_option( 'divi_footer_layout', 222085 );
// Delete default Blog Post
wp_delete_post(1);
}
add_action('pt-ocdi/after_import', 'ocdi_after_import_setup');
//* Add header code
function lovely_header_content() {
$divi_lovely_preloader_images = get_option('divi_lovely_preloader_images');
if( et_get_option('divi_lovely_preloader_option') != '' ){
$divi_lovely_preloader_option = et_get_option('divi_lovely_preloader_option');
}else{
$divi_lovely_preloader_option = 'on';
}
if( $divi_lovely_preloader_option == 'on' ){
?>
get_variation_regular_price( 'min', true );
$min_price_sale = $product->get_variation_sale_price( 'min', true );
$max_price = $product->get_variation_price( 'max', true );
$min_price = $product->get_variation_price( 'min', true );
$price = ( $min_price_sale == $min_price_regular ) ?
wc_price( $min_price_regular ) :
'
' . wc_price( $min_price_regular ) . '' . '
' . wc_price( $min_price_sale ) . '';
return ( $min_price == $max_price ) ?
$price :
sprintf('%s%s', $prefix, $price);
}
add_filter( 'woocommerce_variable_sale_price_html', 'iconic_variable_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'iconic_variable_price_format', 10, 2 );
// Featured Image function
/*function lovely_featured_image( $size = 'full', $class = 'featured-img' ) {
global $post;
if ( has_post_thumbnail( $post->ID ) ) {
// get the title attribute of the post or page
$attachment_id = get_post_thumbnail_id( $post->ID );
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
// echo the featured image
echo $large_image_url[0];
} // end if has_post_thumbnail
}*/
// Begin custom image size for Blog Module
add_filter( 'et_pb_blog_image_height', 'blog_size_h' );
add_filter( 'et_pb_blog_image_width', 'blog_size_w' );
function blog_size_h($height) {
return '450';
}
function blog_size_w($width) {
return '800';
}
add_image_size( 'custom-blog-size', 800, 450 );
// Begin custom image size for Portfolio Thumbs
add_filter( 'et_pb_portfolio_image_height', 'port_size_h' );
add_filter( 'et_pb_portfolio_image_width', 'port_size_w' );
function port_size_h($height) {
return '1000';
}
function port_size_w($width) {
return '1000';
}
add_image_size( 'custom-port-size', 1000, 1000 );
// End custom image size for Portfolio Thumbs