Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

zecke on "Echo do_shortcode with variable"

$
0
0

Hi

I got this code:

<?php $terms = get_the_terms( $post->ID , 'category' );foreach ( $terms as $term ) {$term_link = get_term_link( $term, 'category' ); echo $term_link;} ?>

That echo me category slug in $term_link variable

Now I want to put the variable in xxx place:

<?php echo do_shortcode( '[gallery category="xxx"]' ) ?>

Can You help me and span those two codes into one properly ?

Thank You in advance


Viewing all articles
Browse latest Browse all 8245

Trending Articles