How to get this value inside RETURN
This is more of a PHP question then a WordPress one but the answer is simple, just use PHP’s output buffer by wrapping the first code snippet eg: //create a function for the filters function get_filters(){ $terms = get_terms(‘YOUR-TAXONOMY’); if ( $terms ) { ob_start(); ?> <ul id=”portfolioFilter”> <li class=”filter” data-filter=”all”>All</li> <?php foreach ( $terms … Read more