,,,,
,';
$text = strip_tags($text, $allowed_tags);
$words = preg_split("/[\n\r\t ]+/", $text, $temperas['tempera_excerptwords'] + 1, PREG_SPLIT_NO_EMPTY);
if ( count($words) > $temperas['tempera_excerptwords'] ) {
array_pop($words);
$words[] = $temperas['tempera_excerptdots'];
$text = implode(' ', $words);
} else {
$text = implode(' ', $words);
}
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
if ($temperas['tempera_excerpttags']=='Enable') {
remove_filter( 'get_the_excerpt', 'tempera_excerpt_trim_chars' );
remove_filter( 'get_the_excerpt', 'tempera_excerpt_morelink' );
add_filter( 'get_the_excerpt', 'tempera_excerpt_html' , 8 );
add_filter( 'get_the_excerpt', 'do_shortcode');
}
/**
* Remove inline styles printed when the gallery shortcode is used.
*
* Galleries are styled by the theme in Tempera's style.css.
*
* @since tempera 0.5
* @return string The gallery style filter, with the styles themselves removed.
*/
function tempera_remove_gallery_css( $css ) {
return preg_replace( "##s", '', $css );
}
add_filter( 'gallery_style', 'tempera_remove_gallery_css' );
function tempera_meta_author() {
global $post;
if ( is_single() && get_the_author_meta( 'user_url', $post->post_author ) ) {
echo '';
}
}
add_action ('wp_head','tempera_meta_author');
if ( ! function_exists( 'tempera_meta_before' ) ) :
/**
* Prints HTML with meta information for the current post—date/time and author.
*
* @since tempera 0.5
*/
function tempera_meta_before() {
global $temperas;
// If single page take appropiate settings
if ( is_single() ) {
$temperas['tempera_blog_show'] = $temperas['tempera_single_show'];
}
// Post Author
$output = "";
if ( $temperas['tempera_blog_show']['author'] ) {
$output .= sprintf( '
';
}
// Post categories
if ( $temperas['tempera_blog_show']['category'] && get_the_category_list() ) {
$output .= '' .
get_the_category_list( ', ' ) . ' ';
}
echo $output;
}; // tempera_meta_before()
endif;
if ( ! function_exists( 'tempera_meta_after' ) ) :
/**
* Prints HTML with tags information for the current post. ALso adds the edit button.
*
* @since tempera 0.9
*/
function tempera_meta_after() {
global $temperas;
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list && ($temperas['tempera_blog_show']['tag']) ) { ?>
', '' );
cryout_post_footer_hook();
}; // tempera_meta_after()
endif;
function tempera_meta_infos() {
global $temperas;
switch($temperas['tempera_metapos']):
case "Bottom":
add_action('cryout_post_after_content_hook','tempera_meta_before',10);
add_action('cryout_post_after_content_hook','tempera_meta_after',11);
add_action('cryout_post_after_content_hook','tempera_comments_on',12);
break;
case "Top":
if( !is_single()) {
add_action('cryout_post_meta_hook','tempera_meta_before',10);
add_action('cryout_post_meta_hook','tempera_meta_after',11);
add_action('cryout_post_meta_hook','tempera_comments_on',12);
}
break;
endswitch;
}
add_action('wp_head','tempera_meta_infos');
// Remove category from rel in category tags.
add_filter( 'the_category', 'tempera_remove_category_tag' );
add_filter( 'get_the_category_list', 'tempera_remove_category_tag' );
function tempera_remove_category_tag( $text ) {
$text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text;
}
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
* @since tempera 0.5
*/
if ( ! function_exists( 'tempera_posted_in' ) ) :
function tempera_posted_in() {
global $temperas;
if ($temperas['tempera_single_show']['tag'] || $temperas['tempera_single_show']['bookmark']) :
// Retrieves tag list of current post, separated by commas.
$posted_in = '';
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list && $temperas['tempera_single_show']['tag'] ) {
$posted_in .= ' ';
}
if ($temperas['tempera_single_show']['bookmark'] ) {
$posted_in .= ' '.__('Bookmark','tempera').'.';
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
esc_url( get_permalink() ),
the_title_attribute( 'echo=0' )
);
endif;
}; // tempera_posted_in()
endif;
/**
* Display navigation to next/previous pages when applicable
*/
if ( ! function_exists( 'tempera_content_nav' ) ) :
function tempera_content_nav( $nav_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
1,
'orderby'=> 'none',
'post_mime_type' => 'image',
'post_parent' => $postID,
'post_status' => 'any',
'post_type' => 'any'
);
$attachments = get_children( $args );
//print_r($attachments);
if ($attachments) {
foreach ($attachments as $attachment) {
$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'custom' ) ? wp_get_attachment_image_src( $attachment->ID, 'custom' ) : wp_get_attachment_image_src( $attachment->ID, 'custom' );
return esc_url( $image_attributes[0] );
}
}
}; // cryout_echo_first_image()
/**
* Adds a post thumbnail and if one doesn't exist the first image from the post is used.
*/
if ( ! function_exists( 'tempera_set_featured_thumb' ) ) :
function tempera_set_featured_thumb() {
global $post;
global $temperas;
$image_src = cryout_echo_first_image($post->ID);
if ( function_exists("has_post_thumbnail") && has_post_thumbnail() && ($temperas['tempera_fpost']=='Enable') )
the_post_thumbnail( 'custom', array("class" => "align" . strtolower( $temperas['tempera_falign'] ) . " post_thumbnail" ) );
elseif ( ($temperas['tempera_fpost']=='Enable') && ($temperas['tempera_fauto']=="Enable") && $image_src )
echo '
' ;
};
endif; // tempera_set_featured_thumb
if ( ($temperas['tempera_fpost']=='Enable') && $temperas['tempera_fpostlink'] ) add_filter( 'post_thumbnail_html', 'tempera_thumbnail_link', 10, 2 );
/**
* The thumbnail gets a link to the post's page
*/
function tempera_thumbnail_link( $html, $post_id ) {
$html = '' . $html . '';
return $html;
}; // tempera_thumbnail_link()
// FIN
',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr ( __( 'View all posts by %s', 'tempera' ) ), get_the_author() ),
get_the_author()
);
}
// Post date/time
if ( $temperas['tempera_blog_show']['date'] || $temperas['tempera_blog_show']['time'] ) {
$separator = "";
$date = "";
$time = "";
if ( $temperas['tempera_blog_show']['date'] && $temperas['tempera_blog_show']['time'] ) {
$separator = " - ";
}
if ( $temperas['tempera_blog_show']['date'] ) {
$date = get_the_date();
}
if ( $temperas['tempera_blog_show']['time'] ) {
$time = esc_attr( get_the_time() );
}
$output.= '