Created
January 10, 2020 13:19
-
-
Save axxe16/79ac87f41fd578871ef971e3a64a8e99 to your computer and use it in GitHub Desktop.
passa array a template_part #get_template_part #args #pass #wp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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