Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
passa array a template_part #get_template_part #args #pass #wp
<?php $args = get_query_var('var_post'); ?>
<article class="post">
<h3><a href="<?php echo get_the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php echo the_excerpt(); ?>
<?php echo var_post['foo']; ?>
</article>
<?php
$args = array(
'foo' => 'hello',
);
set_query_var( 'var_post', $args );
get_template_part('piece', 'post');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.