Skip to content

Instantly share code, notes, and snippets.

View MatRouault's full-sized avatar
🏠
Working from home

Mathieu MatRouault

🏠
Working from home
View GitHub Profile
@MatRouault
MatRouault / functions.php
Last active October 5, 2016 21:34 — forked from ThierryA/functions.php
Beans: split post image/content in two columns.
<?php
// Do not include the opening php tag if it is already included in your file.
add_action( 'wp', 'beans_child_setup_document' );
function beans_child_setup_document() {
// Only apply to non-singular layouts.
if ( !is_singular() ) {
<?php
$args = array(
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'posts_per_page' => 100, // don't use -1, pick something reasonable
'no_found_rows' => true, // useful when pagination is not needed.
'update_post_meta_cache' => false, // useful when post meta will not be utilized.
'update_post_term_cache' => false, // useful when taxonomy terms will not be utilized.
// 'fields' => 'ids' // only good if all you need is ids