Error with Custom post type page with custom loop showing custom post taxonomy term by slug

Question

I have a website with custom post type Pages called ‘mini_site_page’
I also created a custom post taxonomy in Posts called ‘mini_site’ and I check taxonomy inside the custom pages
I want to show inside custom pages a custom loop with taxonomy term checked inside custom pages

This code seems to work but with wp_debug ‘true’ I have this error:
Only variables should be passed by reference in /public_html/wp-content/themes/[website]/[page_template].php on line 132

Do you have some suggestions?

name;
$mini_site_slug = $mini_site->slug;
?>

            <?php $related_posts = new WP_Query(array('post_type' => 'post', 'mini_site' => $mini_site_slug, 'posts_per_page' => 100)); ?>
            <?php if ( $related_posts -> have_posts() ) { ?>
                <div class="boxcontainer">
                    <?php while ( $related_posts -> have_posts() ) { $related_posts -> the_post(); ?>
                        <?php get_template_part( 'loop-templates/content', get_post_format() ); ?>
                    <?php } ?>
                </div>
                <div class="clear"></div>
            <?php } ?>
                        <?php wp_reset_query(); ?>
0
Mauro Di Marino 3 months 0 Answers 12 views 0

Leave an answer