';
}
}
endif;
if ( ! function_exists( 'ramza_print_post_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags.
*
* @since 1.0.0
*/
function ramza_print_post_footer() {
// Do nothing for pages.
if ( 'post' !== get_post_type() ) {
return;
}
$categories_list = get_the_category_list( ', ' );
$tags_list = get_the_tag_list( '', ', ' );
echo '';
}
endif;
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function ramza_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'ramza_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( 'ramza_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so ramza_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so ramza_categorized_blog should return false.
return false;
}
}
/**
* Flush out the transients used in ramza_categorized_blog.
*/
function ramza_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Like, beat it. Dig?
delete_transient( 'ramza_categories' );
}
add_action( 'edit_category', 'ramza_category_transient_flusher' );
add_action( 'save_post', 'ramza_category_transient_flusher' );
if ( ! function_exists( 'ramza_print_post_thumbnail' ) ) :
/**
* Prints custom the_post_thumbnail().
*
* @since 1.0.0
*
* @param string $size Post thumbnail size.
*/
function ramza_print_post_thumbnail( $size = '' ) {
if ( ! has_post_thumbnail() ) {
return;
}
echo '
';
echo $html;
}
endif;
if ( ! function_exists( 'ramza_print_the_content' ) ) :
/**
* Print custom the_content(). Combines excerpt, read more link
* and the content into one function.
*
* - Prints automatically trimmed excerpt from the content as default.
* - If read more tag is set, prints the content and read more tag.
* - If custom excerpt is set, prints custom excerpt.
*
* Also includes wp_link_pages().
* @see https://codex.wordpress.org/Function_Reference/wp_link_pages
*
* @since 1.0.0
*/
function ramza_print_the_content() {
global $post;
// Posts loop pages
if ( is_home() || is_archive() || is_search() ) {
if ( strpos( $post->post_content, '' ) ) {
the_content( '' );
echo '