' . wp_kses_post( $anima_excerptcont ). '';
}
add_filter( 'the_content_more_link', 'anima_continue_reading_link' );
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and anima_continue_reading_link().
*/
function anima_auto_excerpt_more( $more ) {
if ( is_admin() ) {
return $more;
}
return cryout_get_option( 'anima_excerptdots' );
}
add_filter( 'excerpt_more', 'anima_auto_excerpt_more' );
/**
* Adds a "Continue Reading" link to post excerpts created using the tag.
*/
function anima_more_link( $more_link, $more_link_text ) {
$anima_excerptcont = cryout_get_option( 'anima_excerptcont' );
$new_link_text = $anima_excerptcont;
if ( preg_match( "/custom=(.*)/", $more_link_text, $m ) ) {
$new_link_text = $m[1];
}
$more_link = str_replace( $more_link_text, $new_link_text, $more_link );
$more_link = str_replace( 'more-link', 'continue-reading-link', $more_link );
return $more_link;
}
add_filter( 'the_content_more_link', 'anima_more_link', 10, 2 );
/**
* Remove inline styles printed when the gallery shortcode is used.
* Galleries are styled by the theme in style.css.
*/
function anima_remove_gallery_css( $css ) {
return preg_replace( "##s", '', $css );
}
add_filter( 'gallery_style', 'anima_remove_gallery_css' );
/**
* Posted in category
*/
if ( ! function_exists( 'anima_posted_category' ) ) :
function anima_posted_category() {
if ( 'post' !== get_post_type() ) return;
$anima_meta_category = cryout_get_option( 'anima_meta_category' );
if ( $anima_meta_category && get_the_category_list() ) {
echo '
'
. get_the_category_list( ' / ' ) .
'';
}
} // anima_posted_category()
endif;
/**
* Posted by author
*/
if ( ! function_exists( 'anima_posted_author' )) :
function anima_posted_author() {
if ( 'post' !== get_post_type() ) return;
$anima_meta_author = cryout_get_option( 'anima_meta_author' );
if ( $anima_meta_author ) {
echo sprintf(
'
%3$s
',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'anima' ), get_the_author() ),
get_the_author()
);
}
} // anima_posted_author
endif;
/**
* Posted by author for single posts
*/
if ( ! function_exists( 'anima_posted_author_single' )) :
function anima_posted_author_single() {
$anima_meta_author = cryout_get_option( 'anima_meta_author' );
$anima_meta_date = cryout_get_option( 'anima_meta_date' );
$anima_meta_date = (( $anima_meta_date && !is_attachment() )?'' . __("on", "anima").'':""); // Hide 'on' if meta date is hidden or if attachment page
global $post;
$author_id = $post->post_author;
if ( $anima_meta_author ) {
echo sprintf(
'' .
get_avatar( $author_id ) . ''. __("Posted by ", "anima") . '' .
'
%3$s
' . $anima_meta_date .
'',
esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'anima' ), get_the_author_meta( 'display_name', $author_id) ),
get_the_author_meta( 'display_name', $author_id)
);
}
} // anima_posted_author_single
endif;
/**
* Posted date/time, tags
*/
if ( ! function_exists( 'anima_posted_date' ) ) :
function anima_posted_date() {
if ( 'post' !== get_post_type() ) return;
$anima_meta_date = cryout_get_option( 'anima_meta_date' );
$anima_meta_time = cryout_get_option( 'anima_meta_time' );
// Post date/time
if ( $anima_meta_date || $anima_meta_time ) {
$date = ''; $time = '';
if ( $anima_meta_date ) { $date = get_the_date(); }
if ( $anima_meta_time ) { $time = esc_attr( get_the_time() ); }
?>
">
>
', '' );
}; // anima_posted_edit()
endif;
/**
* Post format meta
*/
if ( ! function_exists( 'anima_meta_format' ) ) :
function anima_meta_format() {
if ( 'post' !== get_post_type() ) return;
$format = get_post_format();
if ( is_sticky() ) echo '' . __('Featured', 'anima') . '';
if ( current_theme_supports( 'post-formats', $format ) ) {
printf( '',
esc_url( get_post_format_link( $format ) ),
$format,
get_post_format_string( $format )
);
}
} //anima_meta_format()
endif;
/**
* Post format info
*/
function anima_meta_infos() {
add_action( 'cryout_featured_hook', 'anima_posted_edit', 50 ); // Edit button
add_action( 'cryout_post_excerpt_hook', 'anima_comments_on', 50 ); // Comments
if ( is_single() ) { // If single, metas are shown after the title
add_action( 'cryout_post_meta_hook', 'anima_posted_author_single', 10 );
add_action( 'cryout_post_meta_hook', 'anima_posted_date', 20 );
add_action( 'cryout_post_meta_hook', 'anima_posted_category', 30 );
} else { // if blog page, metas are shown at the top of the article
add_action( 'cryout_featured_meta_hook', 'anima_posted_author', 15 );
add_action( 'cryout_featured_meta_hook', 'anima_posted_date', 20 );
add_action( 'cryout_featured_meta_hook', 'anima_posted_category', 30 );
}
add_action( 'cryout_post_utility_hook', 'anima_posted_tags', 40 ); // Tags always at the bottom of the article
add_action( 'cryout_featured_meta_hook', 'anima_meta_format', 10 ); // Post format
} //anima_meta_infos()
add_action( 'wp_head', 'anima_meta_infos' );
/* Remove category from rel in category tags */
function anima_remove_category_tag( $text ) {
$text = str_replace( 'rel="category tag"', 'rel="tag"', $text );
return $text;
} //anima_remove_category_tag()
//add_filter( 'the_category', 'anima_remove_category_tag' );
//add_filter( 'get_the_category_list', 'anima_remove_category_tag' );
/**
* Backup navigation
*/
if ( ! function_exists( 'anima_content_nav' ) ) :
function anima_content_nav( $nav_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
ID ), $featured );
} elseif ( $animas['anima_fpost'] && $animas['anima_fauto'] && empty($featured_image) ) {
// get the first image from post
$featured_image = cryout_post_first_image( $post->ID, $featured );
} else {
// featured image not enabled or not obtainable
$featured_image = '';
};
if ( ! empty( $featured_image[0] ) ) {
$featured_image_url = esc_url( $featured_image[0] );
$featured_image_w = $featured_image[1];
$featured_image_h = $featured_image[2]; ?>