Skip to content

Instantly share code, notes, and snippets.

View davidvandenbor's full-sized avatar

David van den Bor davidvandenbor

View GitHub Profile
@davidvandenbor
davidvandenbor / wordpress_loops.php
Last active August 29, 2015 14:03 — forked from bencooling/Wordpress Loops
WordPress: Loops
<?php /* Main loop ------------------------------------------*/ ?>
<?php if (have_posts()) while (have_posts()): the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php // get_template_part( 'content', 'home' ); ?>
<?php endwhile; ?>
<?php /* Simple alter main loop ------------------------------------------*/ ?>
<?php query_posts('posts_per_page=1&post_type=locations'); ?>
@davidvandenbor
davidvandenbor / wp-query-ref.php
Last active October 13, 2015 17:26 — forked from luetkemj/wp-query-ref.php
WordPress: WP_Query arrays reference
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(