Home › Forums › ACF PRO › Using ACF Pro to create Posts Grid › Reply To: Using ACF Pro to create Posts Grid
That white screen means there is probably a syntax error in your code. When working on PHP code you should enable wp debugging https://codex.wordpress.org/WP_DEBUG
Also I notices that there is an error in what I posted
<?php
$categories = get_field('my_category_field');
// make sure it is an array, if only one is
// selected it may return a single value
if (!is_array($categories)) {
$categories = array($categories);
}
$tags = get_field('my_tags_field');
if (!is_array($tags)) {
$tags = array($tags);
}
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'terms' => $categories
),
array(
'taxonomy' => 'post_tag',
'terms' => $tags
)
)
);
$query = new WP_Query($args);
// loop reuslts here to display posts
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.