Пример #1
0
 /**
  * Excludes featured media from content.
  * The featured media will be displayed at the top in single page
  */
 function wolf_content()
 {
     global $post;
     if (!is_single() && $post->post_excerpt || is_search()) {
         return '<p>' . get_the_excerpt() . '</p>';
     } else {
         $media = wolf_post_media(false);
         $post_types = array('post', 'video');
         $content = get_the_content(wolf_more_text());
         // http://www.youtube.com/watch?v=QhwUydU5_F8&list=UUsLuPQzf-UV3eKrc4F4S0Ew
         // http://www.youtube.com/watch?v=QhwUydU5_F8&list=UUsLuPQzf-UV3eKrc4F4S0Ew
         // debug( $media );
         // debug( $content );
         $array = array('<p>[' => '[', ']</p>' => ']', ']<br />' => ']');
         $content = strtr($content, $array);
         if (in_array(get_post_type(), $post_types) && $media) {
             $new_content = str_replace($media, '', $content);
         } else {
             $new_content = $content;
         }
         return apply_filters('the_content', $new_content);
     }
 }
<?php

$post_id = get_the_ID();
$post_type = get_post_type();
?>
<span class="wolf-slide-caption-container">
	<span class="wolf-slide-caption">
		<span class="wrap">
			<span data-max-font-size="48" class="fittext wolf-slide-title"><?php 
the_title();
?>
</span>
			<span class="wolf-slide-subtitle"><?php 
echo sanitize_text_field(wolf_sample(wolf_excerpt(false), 140));
?>
</span>
			<span class="wolf-slide-button-container">
				<a href="<?php 
the_permalink();
?>
" class="wolf-button border-button medium square in-site"><?php 
echo sanitize_text_field(wolf_more_text());
?>
</a>
			</span>
			<?php 
edit_post_link(__('Edit', 'wolf'), '<span class="edit-link">', '</span>');
?>
		</span><!-- .wrap -->
	</span><!-- .wolf-slide-caption -->
</span><!-- .wolf-slide-caption-container -->
				<div class="entry-content">
					<?php 
if ($format != 'aside' && $format != 'status' && $format != 'link' && $format != 'quote') {
    ?>

						<?php 
    wolf_excerpt();
    ?>

					<?php 
} elseif ($format == 'aside' || $format == 'status') {
    ?>

						<?php 
    the_content(wolf_more_text());
    ?>

					<?php 
}
?>
				</div><!-- .entry-content -->
				<?php 
wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'wolf') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>'));
?>

				<footer class="entry-meta icon-meta-container">
					<?php 
wolf_icon_meta();
?>
				</footer>
Пример #4
0
 /**
  * Excerpt "more" link
  *
  * @access public
  * @param string $more
  * @return string
  */
 function wolf_excerpt_more($more)
 {
     $more = '...<p><a rel="bookmark" class="more-link wolf-button border-button-accent-hover" href="' . get_permalink() . '">' . wolf_more_text() . '</a></p>';
     if (is_search()) {
         $more = '...';
     }
     return $more;
 }