/**
 * Maybe we'll show the latest four posts in a grid!
 *
 * This function is never called in the theme. Its return
 * value can be accessed via the custom "forever-recent-posts"
 * filter.
 *
 * @return array An array of integers representing post IDs.
 * @since Forever 1.0
 */
function forever_recent_four_posts()
{
    // Return early if this feature has been disabled.
    $options = forever_get_theme_options();
    if ('on' != $options['posts_in_columns']) {
        return false;
    }
    if (false === ($latest_post_ids = get_transient('latest_post_ids'))) {
        $args = array('order' => 'DESC', 'ignore_sticky_posts' => 1, 'post__not_in' => forever_featured_posts(), 'posts_per_page' => '4', 'tax_query' => array(array('taxonomy' => 'post_format', 'terms' => array('post-format-status', 'post-format-quote', 'post-format-gallery', 'post-format-image'), 'field' => 'slug', 'operator' => 'NOT IN')));
        $latest = new WP_Query();
        $latest->query($args);
        while ($latest->have_posts()) {
            $latest->the_post();
            $latest_post_ids[] = $latest->post->ID;
        }
        wp_reset_postdata();
    }
    return $latest_post_ids;
}
Exemple #2
0
function forever_wido()
{
    if (!function_exists('forever_get_theme_options')) {
        return false;
    }
    $options = forever_get_theme_options();
    if ('on' != $options['posts_in_columns']) {
        return false;
    }
    remove_filter('the_title', 'widont');
}