<?php get_template_part('single'); ?>
<a href="<?php the_permalink();?>" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_post_thumbnail(); ?> <?php if ( has_post_thumbnail() ) { the_post_thumbnail('news_box'); } else { ?><img src="<?php bloginfo('template_url');?>/images/img-blind.png" alt="Webscene"/><?php } ?>
<h1><?php the_title(); ?></h1>
<?php the_time( get_option( 'date_format' ) ); ?> <?php the_time('d.m.Y'); ?>
<a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php echo get_the_author(); ?></a>
<h2><?php the_category(', ') ?></h2>
<?php if( '' !== get_post()->post_content ) { ?> <div class="page-text"> <?php the_content(); ?> </div> <?php } ?>
w function.php:
function limit_words($string, $word_limit) { $words = explode(' ', $string); return implode(' ', array_slice($words, 0, $word_limit)); }
w kodzie strony:
<?php echo limit_words(get_the_excerpt(), '15'); echo('<span>...</span>'); ?>
w function.php:
add_action( 'after_setup_theme', 'init_post_formats' ); function init_post_formats() { add_theme_support( 'post-formats', array( 'image', 'quote' ) ); }
w kodzie strony:
<?php if ( has_post_format( 'quote' )) { ?> <?php } ?>
–
Agnieszka Trefler (Ruda) - freelancer, web developer, specjalistka od WordPressa z Wrocławia. Z pasją budowania stron, blogowania i fotografowania. Twórca Inspiracji fotograficznych.