', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'blook_pingback_header' ); /** * Returns Posts Query. * * @since Blook 1.0.0 */ if (!function_exists('blook_get_post_query')): function blook_get_post_query($number_of_post, $post_category = '0', $paged = 1) { $post_args = array( 'post_status' => 'publish', 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => true, 'paged'=> absint( $paged ), 'posts_per_page' => absint($number_of_post), ); $post_category = isset($post_category) ? $post_category : '0'; if (absint($post_category) > 0) { $post_args['cat'] = absint($post_category); } $all_posts = new WP_Query($post_args); return $all_posts; } endif; /** * Returns word count of the sentences. * * @since Blook 1.0.0 */ if (!function_exists('blook_get_excerpt')): function blook_get_excerpt($length = 25, $blook_content = null, $post_id = 1) { $length = absint($length); $source_content = preg_replace('`\[[^\]]*\]`', '', $blook_content); $trimmed_content = wp_trim_words($source_content, $length, '...'); return $trimmed_content; } endif;