Build a Grid Layout For WordPress Using WP_Query
Here’s how to build a grid layout for WordPress via shortcodes and WP_Query: A lot of WordPress developers immediately rush to query_posts in order to create custom loops. But, query_posts is meant for altering the main loop of a WordPress page/post (actually, it’s not even recommended for that anymore). Using get_posts() is okay… but, if you want that real WordPress flavor using WP_Query is the way to go. In the video above, I show you how to use WP_Query to create a custom loop inside WordPress in order to build a Pinterest-style grid layout. Here’s the code I used in