Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( has_post_thumbnail() ) {
- the_post_thumbnail( 'thumbnail', array('class'=>'alignleft', 'alt' => get_the_title() , 'title' => get_the_title() ));
- echo contentnoimg(50);} elseif (get_post_image(TRUE)) { echo '<a href='.$link.'><img class="alignleft" src='.$blogurl.'/thumbnail.php?src='.get_post_image().'&h=150&w=150&zc=1&q=99&a=t" alt='.$title.' /></a>' ; echo contentnoimg(50); } else{ echo contentnoimg(50);}?><p></p>
- And this is from functions.php:
- function content($limit) {
- global $post;
- $content = explode(' ', get_the_content(), $limit);
- if (count($content)>=$limit) {
- array_pop($content);
- $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">'.__('Read full post','language') .'</a>';
- } else {
- $content = implode(" ",$content);
- }
- $content = preg_replace('/\[.+\]/','', $content);
- $content = apply_filters('the_content', $content);
- $content = str_replace(']]>', ']]>', $content);
- return $content;
- }
- function contentnoimg($limit) {
- global $post;
- $content = explode(' ', get_the_content(), $limit);
- if (count($content)>=$limit) {
- array_pop($content);
- $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">'.__('Read full post','language') .'</a>';
- } else {
- $content = implode(" ",$content);
- }
- $content = preg_replace('/(<img.+?>)/','', $content);
- $content = apply_filters('the_content', $content);
- $content = str_replace(']]>', ']]>', $content);
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement