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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| /** | |
| * Change your product per page | |
| * @author alispx | |
| */ | |
| add_filter( 'loop_shop_per_page', 'woo_shop_per_page' ); | |
| function woo_shop_per_page() { | |
| return 12; | |
| } |
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 | |
| $thumbnail_id = get_post_thumbnail_id( get_the_ID() ); | |
| $img_url = wp_get_attachment_url( $thumbnail_id ); | |
| if ( ! empty( $thumbnail_id ) ) { | |
| echo wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); | |
| } else { | |
| echo '<img src="http://placehold.it/300x300" />'; | |
| } | |
| ?> |
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 | |
| $args = array( | |
| 'post_type' => 'post_type', | |
| 'post_status' => 'publish', | |
| 'ignore_sticky_posts' => 1, | |
| 'posts_per_page' => 24, | |
| 'orderby' => 'date', | |
| 'order' => 'desc', | |
| ); |
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 $args = array( | |
| 'post_type' => 'post_type', | |
| 'showposts' => 200, | |
| 'orderby' => 'menu_order', | |
| 'order' => 'ASC' | |
| ); | |
| $customquery = new WP_Query( $args ); ?> | |
| <?php |
NewerOlder