Advertisement
Guest User

after theme setup hook for cart wrapping

a guest
Jul 2nd, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <?php
  2.  
  3. /* Add code here that needs to run before the parents functions.php */
  4.  
  5. /*
  6. * Tell WordPress to run post_theme_setup() when the 'after_setup_theme' hook is run.
  7. */
  8.  
  9. add_action( 'after_setup_theme', 'post_theme_setup' );
  10.  
  11. if ( !function_exists( 'post_theme_setup' ) ):
  12. function post_theme_setup() {
  13.  
  14. /* place for code to execute after parents functions.php */
  15. /* the purpose of these code lines is to wrap the cart app in the Creativix theme */
  16.  
  17. function mytheme_open_jigoshop_content_wrappers()
  18. {
  19.     echo '<div class="sub-column"><div class="sub-top"><div class="sub-content"><div class="content">';
  20. }
  21.  
  22. function mytheme_close_jigoshop_content_wrappers()
  23. {
  24.     echo '</div></div></div></div>';
  25. }
  26.  
  27. function mytheme_prepare_jigoshop_wrappers()
  28. {
  29.     remove_action( 'jigoshop_before_main_content', 'jigoshop_output_content_wrapper', 10 );
  30.     remove_action( 'jigoshop_after_main_content', 'jigoshop_output_content_wrapper_end', 10);
  31.  
  32.     add_action( 'jigoshop_before_main_content', 'mytheme_open_jigoshop_content_wrappers', 10 );
  33.     add_action( 'jigoshop_after_main_content', 'mytheme_close_jigoshop_content_wrappers', 10 );
  34. }
  35. add_action( 'wp_head', 'mytheme_prepare_jigoshop_wrappers' );
  36.  
  37. }
  38. endif;
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement