-
-
Save ahmetus/3492284 to your computer and use it in GitHub Desktop.
Create new WP_Query with TextExpander (version 4 required)
This file contains hidden or 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
// New query | |
$%filltext:name=Query Name:default=myquery%_args = array( | |
'post_type' => '%filltext:name=Post Type:default=post%', | |
'order' => '%fillpopup:name=popup 7:default=ASC:DESC%', | |
'orderby' => '%fillpopup:name=popup 9:default=date:ID:rand:title:author%', | |
'post_statust' => 'publish', | |
'posts_per_page' => %filltext:name=Posts Per Page:default=-1% | |
); | |
$%filltext:name=Query Name:default=myquery% = new WP_Query( $featured_args ); | |
if ( $%filltext:name=Query Name:default=myquery%->have_posts() ) { | |
// The Loop | |
while( $%filltext:name=Query Name:default=myquery%->have_posts() ) : $%filltext:name=Query Name:default=myquery%->the_post(); ?> | |
<!-- do stuff here --> | |
<?php endwhile; } | |
wp_reset_postdata(); | |
} //endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment