Пример #1
0
 function standard_post_format_rss($content)
 {
     // If it's a link post format, make sure the link and title are properly rendered
     if ('link' == get_post_format(get_the_ID())) {
         // Get the post title and the post content
         global $post;
         $post_content = $post->post_content;
         $post_title = $post->post_title;
         // If there's no link meta data, then we'll handle this the 3.0 way.
         // @deprecated since we're actually full on incoporating this functionality
         if ('' == get_post_meta(get_the_ID(), 'standard_link_url_field', true)) {
             // Read the attribute of the anchor from the post format
             $title = standard_get_link_post_format_attribute('title');
             $href = standard_get_link_post_format_attribute('href');
             $target = standard_get_link_post_format_attribute('target');
             // Build up the link
             $content = '<a href="' . $href . '" title="' . $title . '" target="' . $target . '">';
             if (strlen(trim($post_title)) > 0) {
                 $content .= $post_title;
             } elseif (strlen(trim($title)) > 0) {
                 $content .= $title;
             } else {
                 $content .= $post_content;
             }
             // end if/else
             $content .= '</a>';
         }
         // end if
         // If it's an image post format, make sure the featured image is prepended to the content
     } elseif ('image' == get_post_format(get_the_ID()) && '' != get_the_post_thumbnail(get_the_ID())) {
         $featured_image = '<p>';
         $featured_image .= '<a href="' . get_permalink(get_the_ID()) . '" target="_blank" title="' . get_the_title() . '">';
         $featured_image .= get_the_post_thumbnail(get_the_ID(), 'large');
         $featured_image .= '</a>';
         $featured_image .= '</p>';
         $content = $featured_image . $content;
     }
     // end if
     return $content;
 }
Пример #2
0
" <?php 
post_class('post format-link clearfix');
?>
>

	<div class="post-header clearfix">
			<div id="content-<?php 
the_ID();
?>
"  class="entry-content clearfix">	
			
				<?php 
// Read the attribute of the anchor from the post format
$title = standard_get_link_post_format_attribute('title');
$href = standard_get_link_post_format_attribute('href');
$target = strlen(standard_get_link_post_format_attribute('target')) > 0 ? standard_get_link_post_format_attribute('target') : '_blank';
$post_title = strip_tags(stripslashes(get_the_title()));
$content = strip_tags(get_the_content());
?>

				<?php 
if (is_single() && '' !== get_the_title()) {
    ?>
					<h1 class="post-title">
						<a href="<?php 
    echo $href;
    ?>
" title="<?php 
    echo strlen(trim($title)) > 0 ? $title : $post_title;
    ?>
" target="<?php