This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'date_query' => array( | |
| array( | |
| 'after' => 'today', | |
| 'inclusive' => true, | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* Don't forget to remove the opening and closing PHP tags */ | |
| if( isset( $_GET['show_all'] ) ){ | |
| add_filter( 'loop_shop_per_page', create_function( '$cols', 'return -1;' ) ); | |
| } else { | |
| add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 10;' ) ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* do not include opening PHP brackets. | |
| Add this content to your category.php file */ | |
| remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // do not include the opening PHP tag | |
| extract( shortcode_atts( array( | |
| 'title' => 'no title', | |
| 'something' => 'value', | |
| ), $atts,) ); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* You probably won't need to include the opening and closing PHP tags. */ | |
| add_action('genesis_pre_get_option_site_layout', 'iampmedia_home_page_layout' ); | |
| function iampmedia_home_page_layout() { | |
| return 'full-width-content'; | |
| } | |
| // for more information, see http://snippetpress.com/genesis/genesis-force-full-width-layout-for-a-single-page/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // first we register the defaults | |
| function iamp_defaults($defaults) { | |
| $defaults['option1'] = ''; | |
| $defaults['option2'] = ''; | |
| return $defaults; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // lets talk variations here | |
| $available_variations = $product->get_available_variations(); | |
| foreach($available_variations as $prod_variation) { | |
| $post_id = $prod_variation['variation_id']; | |
| $post_object = get_post($post_id); | |
| // do what you like with the post object here | |
| // you can add the variation to the product cart by linking to ?add-to-cart={variation_id}&quantity=xxx | |
| echo $post_object->post_title; | |
| } |