• Is it possible to turn this into a variable so I can later call it into an array?

    /* Variable */
    <?php $events = echo $ministry_meta['ministry_events'][0];?>

    Like this

    /* Array */
    <?php $loop = new WP_Query(
            array(
    			'post_type' => 'events',
    			'posts_per_page' => 10,
    			'tax_query' => array(
      				array( 'taxonomy' => 'event-cat',
            			'field' => 'slug',
    					'terms' => $events
    					)
    			)
           ) ); ?>

    This is how I am currently pulling in custom meta information from my custom post type.

    <?php echo $ministry_meta['ministry_events'][0];?>

    I would like to turn it into a variable to I can
    include it in the array. I hope this makes sense. Thanks in advance for any help.

Viewing 1 replies (of 1 total)
  • Thread Starter Ray VanDerLinden

    (@18arsenal28)

    I was able to resolve the issue. Needed to remove ‘echo’ from the variable. Final variable looks like this.

    <?php $events = $ministry_meta['ministry_events'][0];?>

Viewing 1 replies (of 1 total)

The topic ‘Variables in an Array from Custom Meta Data’ is closed to new replies.