Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // BEGIN ENQUEUE PARENT ACTION
- // AUTO GENERATED - Do not modify or remove comment markers above or below:
- if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
- function chld_thm_cfg_parent_css() {
- wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( ) );
- }
- endif;
- add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
- /*
- // ATENÇÃO: Essa parte foi comentada porque tava inserindo um style que não existe. Dava 404 e levava 12 eternos segundos pra carregar.
- if ( !function_exists( 'child_theme_configurator_css' ) ):
- function child_theme_configurator_css() {
- wp_enqueue_style( 'chld_thm_cfg_ext1', trailingslashit( get_theme_root_uri() ) . 'AldeiaCoworking/' );
- }
- endif;
- add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css' );
- */
- // END ENQUEUE PARENT ACTION
- //woocommerce
- remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
- remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
- add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
- add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
- function my_theme_wrapper_start() {
- echo '<section id="main">';
- }
- function my_theme_wrapper_end() {
- echo '</section>';
- }
- add_action( 'after_setup_theme', 'woocommerce_support' );
- function woocommerce_support() {
- add_theme_support( 'woocommerce' );
- }
- //add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
- /**
- * Hook in on activation
- */
- /**
- * Define image sizes
- */
- function aldeia_woocommerce_image_dimensions() {
- global $pagenow;
- if ( ! isset( $_GET['activated'] ) || $pagenow != 'themes.php' ) {
- return;
- }
- $thumbnail = array(
- 'width' => '800', // px
- 'height' => '800', // px
- 'crop' => 0 // false
- );
- // Image sizes
- update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs
- }
- add_action( 'after_switch_theme', 'aldeia_woocommerce_image_dimensions', 1 );
- //hook personalizado single curso
- add_action( 'woocommerce_single_aldeia', 'woocommerce_template_single_title', 5 );
- add_action( 'woocommerce_single_aldeia', 'woocommerce_template_single_price', 10 );
- //hook personalizado single curso botoes
- add_action( 'woocommerce_single_aldeia_btn', 'woocommerce_template_single_add_to_cart', 30 );
- // para exibir 48 produtos por página
- add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 48;' ), 50 );
- function set_posts_per_page_for_towns_cpt( $query ) {
- if ( is_shop() || is_woocommerce() || is_product_category() || is_product_tag() ) {
- $query->set( 'posts_per_page', '48' );
- }
- }
- add_action( 'pre_get_posts', 'set_posts_per_page_for_towns_cpt' );
- if( function_exists('acf_add_options_page') ) {
- acf_add_options_page(array(
- 'page_title' => 'Outras Configurações',
- 'menu_title' => 'Outras configurações',
- 'menu_slug' => 'outras-configuracoes',
- 'capability' => 'edit_posts',
- 'redirect' => false
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement