the_content vs the_excerpt: Theme, obey my will!
-
Stop! Okay, carry on reading, but pssshhht.
Thank you for lending me your attention. The website uses a heavily modified version of the theme “News-Leak“. (I should fork it somewhen, but I have no clue how. However, that is another topic.)
The theme displays posts on the front page differently. The first post gets an full-size image + excerpt (controlled via the more-tag). The other posts just show an excerpt of 20 words. I want the first post to show this behaviour, too.
This is the code of the first post:
<div id="post_holder"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="post_dets"> <div class="post_author"><?php if(get_the_author_meta('userimg') != ""): ?> <img class="Autorenbild" src="<?php the_author_meta( 'userimg' ); ?>" width="40" height="40" /> <?php else: ?> <img src="<?php echo get_template_directory_uri(); ?>/images/no_user_img.jpg" alt="<?php the_title(); ?>" width="40" height="40" /> <?php endif; ?> <span>Geschrieben von:</span><span class="post_details"><?php the_author_posts_link(); ?></span></div> <div class="post_time"><span>Geschrieben am:</span><span class="post_details"><a href="<?php echo get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')); ?>"><?php the_time('F j, Y') ?> </a></span></div> <?php if (!empty($post->post_password)) {?><?php }else { ?><?php if ( comments_open() ) : ?><div id="comments_option">Meinungen<br /><a href="<?php the_permalink() ?>/#leave-comment">Kommentiere</a><div class="comments-counter"><?php comments_popup_link('0', '1', '%', '', ''); ?></div></div><?php ; else : ?><div id="comments_option">Die Kommentare sind geschlossen.</div><?php endif; ?><?php } ?></div> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>><?php the_content('Lesen Sie mehr...'); ?> <?php wp_link_pages( array( 'before' => '<p class="page-link">' . __( 'Pages:' ), 'after' => '</p>' ) ); ?> <div class="post_category"><span>In der Kategorie:</span> <?php the_category(', ' ) ?><?php the_tags('<br /><span>Tags:</span>',' , ','<br />'); ?> </div> </div> </div>
How do I modify it in a way, that it does as I pledge?
Comment: Simply switching “the_content” to the “the_excerpt” doesn’t work. The picture then gets stripped from the front-page.
- The topic ‘the_content vs the_excerpt: Theme, obey my will!’ is closed to new replies.