Skip to content

Instantly share code, notes, and snippets.

César Ribeiro chrdesigner

Block or report user

Report or block chrdesigner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
chrdesigner / show_future_post.php
Last active Dec 29, 2015
Display posts with 'future' status
View show_future_post.php
add_filter('the_posts', 'show_future_posts');
function show_future_posts($posts)
global $wp_query, $wpdb;
if(is_single() && $wp_query->post_count == 0)
$posts = $wpdb->get_results($wp_query->request);
claudiosanches / functions.php
Last active Mar 8, 2017
WordPress - Last posts with ajax.
View functions.php
function cs_last_posts_json() {
$json = array();
$last_posts = get_posts( array(
'posts_per_page' => 5,
'post_type' => 'post'
) );
foreach ( $last_posts as $post ) {
You can’t perform that action at this time.