Skip to content

Instantly share code, notes, and snippets.

@jonasmello
Last active February 23, 2016 00:24
Show Gist options
  • Save jonasmello/813baa5f4141a16e0cb8 to your computer and use it in GitHub Desktop.
Save jonasmello/813baa5f4141a16e0cb8 to your computer and use it in GitHub Desktop.
Wordpress Loop
<?php
wp_reset_query();
$args = array(
"post_type" => "post_type",
"orderby" => "menu_order"
);
$wp_query = new WP_Query();
$wp_query->query($args);
if ( $wp_query->have_posts() )
{
?>
<?php
while ($wp_query->have_posts())
{
$wp_query->the_post();
?>
<?php
}
?>
<?php
}
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment