So I want to return a Wordpress loop that returns just one category, so currently I have something like this
<?php query_posts('cat=5'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
This works great and does exactly what I want it to do
But I want the category number to be set by an ACF, so I have that set up and it's returning my value just as a string on the site, all good again, so now my code looks like this
<p>My category number is - <?php the_field('category_number'); ?></p>
<?php query_posts('cat=5'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
What I want to do is something like this
<p>My category number is - <?php the_field('category_number'); ?></p>
<?php query_posts('"cat=", the_field("category_number")'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
I don't think I'm going about this the right way and can't seem to find an answer for this as I don't think I'm looking for the right thing .. if someone could point me in the right direction on this I'd be really grateful