Multiple Frontend Filters Using Advanced Custom Fields
Multiple Frontend Filters Using Advanced Custom Fields
Multiple Frontend Filters Using Advanced Custom Fields
WP_Query with meta_query dosen’t return results
Shortcode default attributes over-riding non-default attributes
Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
The loop doesn’t really contain anything. It does include methods in order to easily output your data such as the_title(), this is done when calling the_post() Then, within the loop you’ll be able to use get_the_ID() and get_post_meta() to get your custom fields (including ACF ones). So if you have retrieved your desired posts from … Read more
Migrating data from ACF to WordPress custom meta boxes
I resolved the issue by using $dir = plugins_url() . ‘/simple/acf/’; in step 2. I kept everything else the same. // 2. Customize ACF dir add_filter(‘acf/settings/dir’, ‘my_acf_settings_dir’); function my_acf_settings_dir( $dir ) { // update path $dir = plugins_url() . ‘/simple/acf/’; // return return $dir; }
<div class=”pr_grid_cell clearfix”> <?php //for each category, show posts $categories=get_categories(); foreach($categories as $cat) { $args=array( ‘post_type’ => ‘products’, ‘showposts’ => -1, ‘category__in’ => array($cat->term_id) ); $posts = new wp_query($args); // This is the best way to if ($posts->have_posts()) while ($posts->have_posts()) { //condional if/while 2-in-1. If you dont check have_posts, you’ll get an ugly error when … Read more
A custom taxonomy makes perfect sense – here’s hoping I haven’t missed something: $songs = get_posts( array( ‘post_type’ => ‘song’, ) ); $index = array(); // Build an album_id => songs index foreach ( $songs as $song ) { if ( $albums = get_the_terms( $song->ID, ‘album’ ) ) $index[ $albums[0]->term_id ][] = $song; else $index[ … Read more
Multisite wp_query & switch_to_blog issue