$paged ));
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', get_post_format());
}
exit;
}
add_action('wp_ajax_infinite_scroll', 'pingraphy_infinitepaginate'); // for logged in user
add_action('wp_ajax_nopriv_infinite_scroll', 'pingraphy_infinitepaginate');
endif;
if ( ! function_exists( 'pingraphy_the_post_navigation' ) ) :
/**
|------------------------------------------------------------------------------
| Display navigation to next/previous post when applicable.
|------------------------------------------------------------------------------
|
| @todo Remove this function when WordPress 4.3 is released.
|
*/
function pingraphy_the_post_navigation() {
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
' . esc_html__( 'Posted in %1$s', 'pingraphy' ) . '', $categories_list ); // WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__( ', ', 'pingraphy' ) );
if ( $tags_list ) {
printf( '' . esc_html__( 'Tagged %1$s', 'pingraphy' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
comments_popup_link( esc_html__( 'Leave a comment', 'pingraphy' ), esc_html__( '1 Comment', 'pingraphy' ), esc_html__( '% Comments', 'pingraphy' ) );
echo '';
}
edit_post_link( esc_html__( 'Edit', 'pingraphy' ), '', '' );
}
endif;
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function pingraphy_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'pingraphy_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'pingraphy_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so pingraphy_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so pingraphy_categorized_blog should return false.
return false;
}
}
/**
* Flush out the transients used in pingraphy_categorized_blog.
*/
function pingraphy_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Like, beat it. Dig?
delete_transient( 'pingraphy_categories' );
}
add_action( 'edit_category', 'pingraphy_category_transient_flusher' );
add_action( 'save_post', 'pingraphy_category_transient_flusher' );
if (!function_exists('pingraphy_social_icons')) :
/**
|------------------------------------------------------------------------------
| Social Sharing Buttons
|------------------------------------------------------------------------------
|
*/
function pingraphy_social_icons($position) {
global $post;
?>