ashishsthanp

Add button to WC

Jan 13th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2. /*
  3. * Child theme functions file
  4. *
  5. */
  6. function zakra_child_enqueue_styles() {
  7.  
  8. $parent_style = 'zakra-style'; //parent theme style handle 'zakra-style'
  9.  
  10. //Enqueue parent and chid theme style.css
  11. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
  12. wp_enqueue_style( 'zakra_child_style',
  13. get_stylesheet_directory_uri() . '/style.css',
  14. array( $parent_style ),
  15. wp_get_theme()->get('Version')
  16. );
  17.  
  18. wp_enqueue_script('zakra-child-script', get_stylesheet_directory_uri() . '/script.js', array( 'jquery' ), null, true);
  19. }
  20. add_action( 'wp_enqueue_scripts', 'zakra_child_enqueue_styles' );
  21.  
  22. function zakra_child_product_btn() {
  23. global $product;
  24. $link = $product->get_permalink();
  25. echo '<a href="' . $link . '">'. __( 'Read more', 'zakra-child' ) .'</a>';
  26. }
  27. add_action('woocommerce_after_shop_loop_item','zakra_child_product_btn');
Advertisement
Add Comment
Please, Sign In to add comment