I am using a wordpress plugin called advanced custom fields that basically creates custom write panels on the backend, and gives you php shortcodes to insert into your template files.
It looks like the following:
<?php echo get_field('video-slug'); ?>
This will return a slug value that I need for the wordpress loop.
My wordpress loop is as follows:
<?php $loop = new WP_Query( array( 'post_type' => 'videos', 'artist_name' => 'HERE IS WHERE I WANT THE SLUG', 'post_child' => 0, 'posts_per_page' => 5 ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li>
CONTENT HERE
</li>
<?php endwhile; ?>
If you notice, the first line of the loop requires that slug that was created above. I cannot simply enter <?php echo get_field('video-slug'); ?> into the loop because it will cause a php error. Perhaps I can create a variable and then put that into the loop?
Basically, I need to know how to take a php generated value, perhaps store it in a variable, and then use that variable in my loop as follows: 'artist_name' => '$variable' or something like this. Thanks!