esc_html__( 'Main menu', 'books-printing' ), )); add_theme_support( 'responsive-embeds' ); add_theme_support( 'woocommerce' ); add_theme_support( 'align-wide' ); add_theme_support('title-tag'); add_theme_support('automatic-feed-links'); add_theme_support( 'wp-block-styles' ); add_theme_support('post-thumbnails'); add_theme_support( 'custom-background', array( 'default-color' => 'f3f3f3' )); add_theme_support( 'custom-logo', array( 'height' => 120, 'width' => 240, 'flex-height' => true, ) ); add_theme_support( 'custom-header', array( 'default-image' => get_parent_theme_file_uri( '/assets/images/default-header-image.png' ), 'width' => 1920, 'flex-width' => true, 'height' => 550, 'flex-height' => true, 'header-text' => false, )); register_default_headers( array( 'default-image' => array( 'url' => '%s/assets/images/default-header-image.png', 'thumbnail_url' => '%s/assets/images/default-header-image.png', 'description' => __( 'Default Header Image', 'books-printing' ), ), ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); add_editor_style( array( '/assets/css/editor-style.css' ) ); global $pagenow; if (is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] )) { add_action('admin_notices', 'books_printing_activation_notice'); } } add_action( 'after_setup_theme', 'books_printing_after_setup_theme', 999 ); } function books_printing_activation_notice() { echo '
'; echo '
'; echo '
'; echo '

'. esc_html__( 'Welcome to WPElemento', 'books-printing' ) .'

'; echo '

'. esc_html__( 'Thank you for choosing Books Printing theme .To setup the theme, please visit the get started page.', 'books-printing' ) .'

'; echo ''. esc_html__( 'GET STARTED', 'books-printing' ) .''; echo ''. esc_html__( 'BUY NOW', 'books-printing' ) .''; echo ''. esc_html__( 'DEMO', 'books-printing' ) .''; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '
'; } /* Get post comments */ if (!function_exists('books_printing_comment')) : /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. */ function books_printing_comment($comment, $args, $depth){ if ('pingback' == $comment->comment_type || 'trackback' == $comment->comment_type) : ?>
  • >
    ', ''); ?>
  • >
    %s', get_comment_author_link() ); ?>
    ', '' ); ?>
    comment_approved) : ?>

    'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
    ', 'after' => '
    ' ) ) ); ?>
    esc_html__('Sidebar','books-printing'), 'id' => 'books-printing-sidebar', 'description' => esc_html__('This sidebar will be shown next to the content.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Page Sidebar','books-printing'), 'id' => 'sidebar-2', 'description' => esc_html__('This sidebar will be shown next to the content.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Sidebar three','books-printing'), 'id' => 'sidebar-3', 'description' => esc_html__('This sidebar will be shown on blog pages.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Footer sidebar 1','books-printing'), 'id' => 'footer1-sidebar', 'description' => esc_html__('It appears in the footer 1.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Footer sidebar 2','books-printing'), 'id' => 'footer2-sidebar', 'description' => esc_html__('It appears in the footer 2.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Footer sidebar 3','books-printing'), 'id' => 'footer3-sidebar', 'description' => esc_html__('It appears in the footer 3.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => esc_html__('Footer sidebar 4','books-printing'), 'id' => 'footer4-sidebar', 'description' => esc_html__('It appears in the footer 4.', 'books-printing'), 'before_widget' => '', 'before_title' => '

    ', 'after_title' => '

    ' )); } add_action( 'widgets_init', 'books_printing_widgets_init' ); } function books_printing_the_breadcrumb() { if (!is_home()) { echo ''; bloginfo('name'); echo " >> "; if (is_category() || is_single()) { the_category(' , '); if (is_single()) { echo " >> "; the_title(); } } elseif (is_page()) { the_title(); } } } /** * logo resizer */ function books_printing_logo_resizer() { $books_printing_theme_logo_size_css = ''; $books_printing_theme_custom_logo_id = get_theme_mod( 'custom_logo' ); $books_printing_theme_logo_width = get_theme_mod( 'books_printing_logo_resizer', 150 ); // Default to 200 if not set $books_printing_theme_logo_height = $books_printing_theme_logo_width * 0.5; if ( $books_printing_theme_custom_logo_id ) { $books_printing_theme_logo_data = wp_get_attachment_image_src( $books_printing_theme_custom_logo_id, 'full' ); $books_printing_theme_logo_url = $books_printing_theme_logo_data[0]; $books_printing_theme_original_width = $books_printing_theme_logo_data[1]; $books_printing_theme_original_height = $books_printing_theme_logo_data[2]; $books_printing_theme_aspect_ratio = $books_printing_theme_original_height / $books_printing_theme_original_width; $books_printing_theme_logo_height = $books_printing_theme_logo_width * $books_printing_theme_aspect_ratio; } $books_printing_theme_logo_size_css = ' .custom-logo{ height: '.esc_attr($books_printing_theme_logo_height).'px !important; width: '.esc_attr($books_printing_theme_logo_width).'px !important; } '; wp_add_inline_style( 'books-printing-style',$books_printing_theme_logo_size_css ); } add_action( 'wp_enqueue_scripts', 'books_printing_logo_resizer' ); /** * Change number or products per row to 3 */ add_filter('loop_shop_columns', 'books_printing_loop_columns', 999); if (!function_exists('books_printing_loop_columns')) { function books_printing_loop_columns() { return get_theme_mod( 'books_printing_products_per_row', '3' ); } } //Change number of products that are displayed per page (shop page) add_filter( 'loop_shop_per_page', 'books_printing_products_per_page' ); function books_printing_products_per_page( $cols ) { return get_theme_mod( 'books_printing_products_per_page',9); } function books_printing_sanitize_phone_number( $phone ) { return preg_replace( '/[^\d+]/', '', $phone ); } function books_printing_enqueue_setting() { define('BOOKS_PRINTING_FREE_THEME_DOC',__('https://preview.wpelemento.com/theme-documentation/books-printing/','books-printing')); define('BOOKS_PRINTING_SUPPORT',__('https://wordpress.org/support/theme/books-printing/','books-printing')); define('BOOKS_PRINTING_REVIEW',__('https://wordpress.org/support/theme/books-printing/reviews/','books-printing')); define('BOOKS_PRINTING_BUY_NOW',__('https://www.wpelemento.com/products/printing-wordpress-theme','books-printing')); define('BOOKS_PRINTING_LIVE_DEMO',__('https://preview.wpelemento.com/books-printing/','books-printing')); define('BOOKS_PRINTING_THEME_BUNDLE',__('https://www.wpelemento.com/products/wordpress-theme-bundle','books-printing')); require get_template_directory() .'/includes/tgm/tgm.php'; require get_template_directory() . '/includes/customizer.php'; load_template( trailingslashit( get_template_directory() ) . '/includes/go-pro/class-upgrade-pro.php' ); /* Plugin Activation */ require get_template_directory() . '/includes/getstart/plugin-activation.php'; /* Implement the About theme page */ require get_template_directory() . '/includes/getstart/getstart.php'; require get_template_directory() . '/includes/product-create.php'; if( class_exists( 'Whizzie' ) ) { $Whizzie = new Whizzie(); } add_filter('wpelemento_importer_plugins_list', function ($plugins) { $desired_order = ['woocommerce', 'yith-woocommerce-wishlist' , 'woolentor-addons']; foreach (['all', 'install', 'update', 'activate'] as $section) { if (!isset($plugins[$section])) continue; $reordered = []; foreach ($desired_order as $slug) { if (isset($plugins[$section][$slug])) { $reordered[$slug] = $plugins[$section][$slug]; unset($plugins[$section][$slug]); } } $plugins[$section] = $reordered + $plugins[$section]; } return $plugins; }); } add_action('after_setup_theme', 'books_printing_enqueue_setting'); ?>