2

There are a few to do this: Using double quotes Don't forget to escape the double quotes inside the string. global $post; echo do_shortcode("[sc name=\"$post->post_name\"]"); Using sigle quotes global $post; echo do_shortcode("[sc name='$post->post_name']"); Using sprintf global $post; echo do_shortcode( sprintf('[sc ...


1

In case anyone needs it, here was my final code: <?php //LIST ALL DOCUMENTS add_shortcode('listDocs','listDocs'); function listDocs(){ $params = array( 'paged' => get_query_var('paged', 1), 'posts_per_page' => 25, 'post_type' => 'product', 'product_cat' => 'documents' ); $wc_query = new WP_Query($...


Only top voted, non community-wiki answers of a minimum length are eligible