',
)
);
}
add_action( 'widgets_init', 'azera_shop_widgets_init' );
/**
* Fallback Menu
*
* If the menu doesn't exist, the fallback function to use.
*/
function azera_shop_wp_page_menu() {
echo '
'Intergeo Maps - Google Maps Plugin',
'slug' => 'intergeo-maps',
'required' => false,
),
array(
'name' => 'Pirate Forms',
'slug' => 'pirate-forms',
'required' => false,
),
array(
'name' => 'WooCommerce',
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => 'Azera Shop Companion',
'slug' => 'azera-shop-companion',
'required' => false,
),
);
$config = array(
'default_path' => '',
'menu' => 'tgmpa-install-plugins',
'has_notices' => true,
'dismissable' => true,
'dismiss_msg' => '',
'is_automatic' => false,
'message' => '',
'strings' => array(
'page_title' => esc_html__( 'Install Required Plugins', 'azera-shop' ),
'menu_title' => esc_html__( 'Install Plugins', 'azera-shop' ),
'installing' => esc_html__( 'Installing Plugin: %s', 'azera-shop' ),
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'azera-shop' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'azera-shop' ),
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'azera-shop' ),
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'azera-shop' ),
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'azera-shop' ),
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'azera-shop' ),
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'azera-shop' ),
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'azera-shop' ),
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'azera-shop' ),
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'azera-shop' ),
'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'azera-shop' ),
'return' => esc_html__( 'Return to Required Plugins Installer', 'azera-shop' ),
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'azera-shop' ),
'complete' => esc_html__( 'All plugins installed and activated successfully. %s', 'azera-shop' ),
'nag_type' => 'updated',
),
);
tgmpa( $plugins, $config );
}
add_action( 'wp_footer','azera_shop_php_style', 100 );
/**
* Theme inline style.
*/
function azera_shop_php_style() {
$custom_css = '';
$azera_shop_title_color = get_theme_mod( 'azera_shop_title_color' );
$azera_shop_text_color = get_theme_mod( 'azera_shop_text_color' );
$azera_shop_enable_move = get_theme_mod( 'azera_shop_enable_move' );
$azera_shop_frontpage_opacity = get_theme_mod( 'azera_shop_frontpage_opacity', apply_filters( 'azera_shop_frontpage_opacity_filter','rgba(0, 0, 0, 0.1)' ) );
$azera_shop_blog_opacity = get_theme_mod( 'azera_shop_blog_opacity', apply_filters( 'azera_shop_blog_opacity_filter','rgba(0, 0, 0, 0.1)' ) );
$llorix_one_header_image = get_header_image();
if ( ! empty( $azera_shop_title_color ) ) {
$custom_css .= '.dark-text { color: ' . $azera_shop_title_color . ' }';
}
if ( ! empty( $azera_shop_text_color ) ) {
$custom_css .= 'body{ color: ' . $azera_shop_text_color . '}';
}
if ( ( empty( $azera_shop_enable_move ) || ! $azera_shop_enable_move ) && ( is_front_page() || is_page_template( 'template-frontpage.php' ) ) ) {
if ( ! empty( $llorix_one_header_image ) ) {
$custom_css .= '.header{ background-image: url(' . $llorix_one_header_image . ');}';
}
}
if ( ! empty( $azera_shop_frontpage_opacity ) ) {
$custom_css .= '.overlay-layer-wrap{ background:' . $azera_shop_frontpage_opacity . ';}';
}
if ( ! empty( $azera_shop_blog_opacity ) ) {
$custom_css .= '.archive-top .section-overlay-layer{ background:' . $azera_shop_blog_opacity . ';}';
}
wp_add_inline_style( 'azera-shop-style', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'azera_shop_php_style', 100 );
$pro_functions_path = azera_shop_get_file( '/pro/functions.php' );
if ( file_exists( $pro_functions_path ) ) {
require $pro_functions_path;
}
function azera_shop_get_file( $file ) {
$file_parts = pathinfo( $file );
$accepted_ext = array( 'jpg','img','png','css','js' );
if ( in_array( $file_parts['extension'], $accepted_ext ) ) {
$file_path = get_stylesheet_directory() . $file;
if ( file_exists( $file_path ) ) {
return esc_url( get_stylesheet_directory_uri() . $file );
} else {
return esc_url( get_template_directory_uri() . $file );
}
}
}
/**
* WooCommerce Extra Feature
* --------------------------
*
* Change number of related products on product page
* Set your own value for 'posts_per_page'
*/
add_filter( 'woocommerce_output_related_products_args', 'azera_shop_related_products_args' );
function azera_shop_related_products_args( $args ) {
$args['posts_per_page'] = 4;
$args['columns'] = 4;
return $args;
}
function azera_shop_responsive_embed( $html, $url, $attr, $post_ID ) {
$return = '
';
}
}
}
add_action( 'blog_header','azera_shop_blog_header' );
if ( ! function_exists( 'azera_shop_footer_powered_by' ) ) {
/**
* Display the powered by section in the footer
*/
function azera_shop_footer_powered_by() {
?>