Skip to content

Instantly share code, notes, and snippets.

View henryhu712's full-sized avatar

henryhu henryhu712

View GitHub Profile

Spf13.vim lost syntax when editing PHP

Fix it with set

:syn on

Reference: spf13/PIV#15

@henryhu712
henryhu712 / wp_get_all_posts_of_a_type.php
Last active March 23, 2016 05:22
Wordpress - Get all posts of a custom type 'campaign' #wordpress
$loop = new WP_Query( array(
'post_type' => 'campaign',
'posts_per_page' => -1, // It will return all posts.
));
while ( $loop->have_posts() ) {
$loop->the_post();
$post_id = get_the_ID();
$post_title = get_the_title();
}