Build a custom WP Query loop for getting WooCommerce ‘out of stock’ products

Creating a template to show only sold / out of stock items is sometimes neccesary when clients sell one-off items. I took the approach of creating a custom page template which allowed me to turn off “Show out of stock items” in all other WooCommerce pages. This allows visibility of these items on the specified page only.

I made a quick page template which would only get these products by using WordPress Meta Query properties in the loop and you can combine the meta key/values with the information found in a comment by Tareq on Meta Keys for attributes.

Here is the loop I created for this run:

$args = array( 'post_type' => 'product', 'posts_per_page' => 30, 'orderby' => 'date', 'order' => 'DESC', 'meta_query' => array(
array(
'key' => '_stock_status',
'value' => 'outofstock',
'compare' => '='
)
)
);
$loop = new WP_Query( $args );

If you want to get items which are in stock only, you can change the value to “instock”.

CSS Transitions

If you haven’t used transitions before, here’s a brief introduction. There is a lot of duplication due to vendor prefixes – until the specification if finalised, this will persist.

Original Source
via IFTTT and Pocket.

9 Essential Gravity forms Addons

The wordpress bloggers will love this Gravity forms addons because it is the best form processing plugin for wordpress blogs till date. No plugin can be compared to the features and functionalities provided by this plugin. If you haven’t used this plugin, read this review about this plugin.

Original Source
via IFTTT and Pocket.

2014 SEO Playbook: On-Page Factors

Welcome to part 2 of my annual SEO playbook. (Click here for part 1.) I have to thank Danny Sullivan and the Search Engine Land team for giving me the perfect outline for the 2014 playbook, the Periodic Table of SEO Success Factors.

Original Source
via IFTTT and Pocket.