Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. <?php
  2.  
  3. // BEGIN ENQUEUE PARENT ACTION
  4. // AUTO GENERATED - Do not modify or remove comment markers above or below:
  5.  
  6. if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
  7. function chld_thm_cfg_parent_css() {
  8. wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( ) );
  9. }
  10. endif;
  11. add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
  12.  
  13. /*
  14. // ATENÇÃO: Essa parte foi comentada porque tava inserindo um style que não existe. Dava 404 e levava 12 eternos segundos pra carregar.
  15.  
  16. if ( !function_exists( 'child_theme_configurator_css' ) ):
  17. function child_theme_configurator_css() {
  18. wp_enqueue_style( 'chld_thm_cfg_ext1', trailingslashit( get_theme_root_uri() ) . 'AldeiaCoworking/' );
  19. }
  20. endif;
  21. add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css' );
  22. */
  23.  
  24. // END ENQUEUE PARENT ACTION
  25.  
  26. //woocommerce
  27.  
  28. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
  29. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
  30.  
  31. add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
  32. add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
  33.  
  34. function my_theme_wrapper_start() {
  35. echo '<section id="main">';
  36. }
  37.  
  38. function my_theme_wrapper_end() {
  39. echo '</section>';
  40. }
  41.  
  42. add_action( 'after_setup_theme', 'woocommerce_support' );
  43. function woocommerce_support() {
  44. add_theme_support( 'woocommerce' );
  45. }
  46.  
  47. //add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
  48.  
  49. /**
  50. * Hook in on activation
  51. */
  52. /**
  53. * Define image sizes
  54. */
  55. function aldeia_woocommerce_image_dimensions() {
  56. global $pagenow;
  57.  
  58. if ( ! isset( $_GET['activated'] ) || $pagenow != 'themes.php' ) {
  59. return;
  60. }
  61.  
  62. $thumbnail = array(
  63. 'width' => '800', // px
  64. 'height' => '800', // px
  65. 'crop' => 0 // false
  66. );
  67. // Image sizes
  68. update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs
  69. }
  70. add_action( 'after_switch_theme', 'aldeia_woocommerce_image_dimensions', 1 );
  71.  
  72. //hook personalizado single curso
  73. add_action( 'woocommerce_single_aldeia', 'woocommerce_template_single_title', 5 );
  74. add_action( 'woocommerce_single_aldeia', 'woocommerce_template_single_price', 10 );
  75.  
  76. //hook personalizado single curso botoes
  77. add_action( 'woocommerce_single_aldeia_btn', 'woocommerce_template_single_add_to_cart', 30 );
  78.  
  79. // para exibir 48 produtos por página
  80. add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 48;' ), 50 );
  81.  
  82. function set_posts_per_page_for_towns_cpt( $query ) {
  83. if ( is_shop() || is_woocommerce() || is_product_category() || is_product_tag() ) {
  84. $query->set( 'posts_per_page', '48' );
  85. }
  86. }
  87. add_action( 'pre_get_posts', 'set_posts_per_page_for_towns_cpt' );
  88.  
  89.  
  90. if( function_exists('acf_add_options_page') ) {
  91.  
  92. acf_add_options_page(array(
  93. 'page_title' => 'Outras Configurações',
  94. 'menu_title' => 'Outras configurações',
  95. 'menu_slug' => 'outras-configuracoes',
  96. 'capability' => 'edit_posts',
  97. 'redirect' => false
  98. ));
  99.  
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement