コード例 #1
0
ファイル: init.php プロジェクト: rongandat/best-picture
function wp_rp_fetch_posts_and_title()
{
    $options = wp_rp_get_options();
    $limit = $options['max_related_posts'];
    // quirky stuff due to WPML compatibility
    $title_option = get_option('wp_rp_options', false);
    $title = __($title_option['related_posts_title'], 'wp_related_posts');
    $related_posts = array();
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts_v2', $limit);
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts', $limit);
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_random_posts', $limit);
    if (function_exists('qtrans_postsFilter')) {
        $related_posts = qtrans_postsFilter($related_posts);
    }
    return array("posts" => $related_posts, "title" => $title);
}
コード例 #2
0
function wp_rp_fetch_posts_and_title()
{
    $options = wp_rp_get_options();
    $limit = $options['max_related_posts'];
    $title = $options["related_posts_title"];
    $related_posts = array();
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts_v2', $limit);
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts', $limit);
    wp_rp_append_posts($related_posts, 'wp_rp_fetch_random_posts', $limit);
    if (function_exists('qtrans_postsFilter')) {
        $related_posts = qtrans_postsFilter($related_posts);
    }
    return array("posts" => $related_posts, "title" => $title);
}