Skip to content

Instantly share code, notes, and snippets.

Avatar

César Ribeiro chrdesigner

View GitHub Profile
@chrdesigner
chrdesigner / show_future_post.php
Last active Dec 29, 2015
Display posts with 'future' status
View show_future_post.php
<?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
claudiosanches / functions.php
Last active Mar 8, 2017
WordPress - Last posts with ajax.
View functions.php
<?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 ) {
View README.md
You can’t perform that action at this time.