I have some problem here with some code in Wordpress.
<?php
$output="";
foreach($type2 as $t) {$output.= "'".$t->slug."',"; }
echo $output;
?>
This code outputs this:
'cocinas','banos-y-spa','mobiliario-de-hogar',
The problem comes when I want to use $output to put it in an array:
<?php
if(is_tax( 'type', array ($output))) {
putRevSlider(get_queried_object()->slug);}
?>
The strange thing is that this one does work ok, although it's not useful, because I need it to be dynamic:
<?php
if(is_tax( 'type', array ('cocinas','banos-y-spa','mobiliario-de-hogar',))) {
putRevSlider(get_queried_object()->slug);}
?>
Why doesn't $output work inside the array if it has the same values?