Skip to content

Instantly share code, notes, and snippets.

@infoscigeek
infoscigeek / orderby-multiple-meta-values.php
Last active October 31, 2016 14:57
How to orderby using multiple custom fields / meta values
<?
//How to orderby using multiple meta values
$query = new WP_Query(
array(
'post_type' => 'sessions',
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'AND',
'hour_clause' => array(
'key' => 'start_hour',
@bhongy
bhongy / Wordpress: Do if the_content is not empty
Last active September 15, 2023 03:36
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php if ( get_the_content() ) { ?>
// do or output something
<?php } ?> // break php tag for HTML block