Specify image dimensions

In your theme’s functions.php file you can add add_image_size( ‘thumb’, 600, 350, true ); add_image_size( ‘thumbnil’, 600, 350, true ); add_image_size( ‘medium’, 600, 350, true ); add_image_size( ‘large’, 600, 350, true ); add_image_size( ‘post-thumbnail’, 600, 350, true ); add_image_size( ‘{custom-image-type}’, 600, 350, true ); For more information have a look at http://codex.wordpress.org/Function_Reference/add_image_size

WP_Query for WooCommerce Products

<ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 12 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); wc_get_template_part( ‘content’, ‘product’ ); endwhile; } else { echo __( ‘No products found’ ); } wp_reset_postdata(); ?> </ul><!–/.products–>

jQuery in header or footer

There is a lot of leftovers in script-related articles in Codex that are not entirely correct (putting it mildly). The enqueue should not be done before wp_head(), it should be done on wp_enqueue_scripts. Which is technically early inside wp_head(). It doesn’t harm performance, because registering/enqueueing script is merely explaining to WordPress how it should be … Read more

How to concatenate inside the _e() function the right way?

the_search_query() echoes itself, so by putting it into another echo function (what _e() is) you’ll get result as in second example. It isn’t recommended to use variables or function inside l18n functions, because they can’t be translated, for more information see Otto’s: Internationalization: You’re probably doing it wrong. So you should use code like this: … Read more