WordPress.org

Ready to get started?Download WordPress

Forums

Trying to show only the excerpt rather than full post on Yoko (6 posts)

  1. sheenp
    Member
    Posted 1 year ago #

    Hi everyone!

    I've been doing my best to go through all of the previous forum posts to find a solution but I'm stuck. Please help me understand what to change in the Yoko theme in order to show only excerpts on the main blog page rather than the full post.

    Here's what I have in the index.php

    <?php
    /**
     * @package WordPress
     * @subpackage Yoko
     */
    
    get_header(); ?>
    
    <div id="wrap">
    <div id="main">
    	<div id="content">
    	<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', get_post_format() ); ?>
    
    				<?php endwhile; ?>
    
    				<?php /* Display navigation to next/previous pages when applicable */ ?>
    				<?php if (  $wp_query->max_num_pages > 1 ) : ?>
    					<nav id="nav-below">
    						<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'yoko' ) ); ?></div>
    						<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'yoko' ) ); ?></div>
    					</nav><!-- end nav-below -->
    				<?php endif; ?>
    	</div><!-- end content -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thank you!!
    Sheen

  2. WordPress Bum
    Member
    Posted 1 year ago #

    It isn't in this file.

    <?php get_template_part( 'content', get_post_format() ); ?>

    That means it is in another template file. Look for a content template and find the_content and change to the_excerpt.

  3. Vel252
    Member
    Posted 1 year ago #

    Have same question bus using Twenty Ten. The closest template section I could find was the following from the Stylesheet:

    /* =Content
    -------------------------------------------------------------- */
    
    #main {
    	clear: both;
    	overflow: hidden;
    	padding: 40px 0 0 0;
    }
    #content {
    	margin-bottom: 36px;
    }
    #content,
    #content input,
    #content textarea {
    	color: #333;
    	font-size: 16px;
    	line-height: 24px;
    }
    #content p,
    #content ul,
    #content ol,
    #content dd,
    #content pre,
    #content hr {
    	margin-bottom: 24px;
    }
    #content ul ul,
    #content ol ol,
    #content ul ol,
    #content ol ul {
    	margin-bottom: 0;
    }
    #content pre,
    #content kbd,
    #content tt,
    #content var {
    	font-size: 15px;
    	line-height: 21px;
    }
    #content code {
    	font-size: 13px;
    }
    #content dt,
    #content th {
    	color: #000;
    }
    #content h1,
    #content h2,
    #content h3,
    #content h4,
    #content h5,
    #content h6 {
    	color: #000;
    	line-height: 1.5em;
    	margin: 0 0 20px 0;
    }
    #content table {
    	border: 1px solid #e7e7e7;
    	margin: 0 -1px 24px 0;
    	text-align: left;
    	width: 100%;
    }
    #content tr th,
    #content thead th {
    	color: #888;
    	font-size: 12px;
    	font-weight: bold;
    	line-height: 18px;
    	padding: 9px 24px;
    }
    #content tr td {
    	border-top: 1px solid #e7e7e7;
    	padding: 6px 24px;
    }
    #content tr.odd td {
    	background: #f2f7fc;
    }
    .hentry {
    	margin: 0 0 48px 0;
    }
    .home .sticky {
    	background: #f2f7fc;
    	border-top: 4px solid #000;
    	margin-left: -20px;
    	margin-right: -20px;
    	padding: 18px 20px;
    }
    .single .hentry {
    	margin: 0 0 36px 0;
    }
    .page-title {
    	color: #000;
    	font-size: 14px;
    	font-weight: bold;
    	margin: 0 0 36px 0;
    }
    .page-title span {
    	color: #333;
    	font-size: 16px;
    	font-style: italic;
    	font-weight: normal;
    }
    .page-title a:link,
    .page-title a:visited {
    	color: #888;
    	text-decoration: none;
    }
    .page-title a:active,
    .page-title a:hover {
    	color: #ff4b33;
    }
    #content .entry-title {
    	color: #000;
    	font-size: 21px;
    	font-weight: bold;
    	line-height: 1.3em;
    	margin-bottom: 0;
    }
    .entry-title a:link,
    .entry-title a:visited {
    	color: #000;
    	text-decoration: none;
    }
    .entry-title a:active,
    .entry-title a:hover {
    	color: #ff4b33;
    }
    .entry-meta {
    	color: #888;
    	font-size: 12px;
    }
    .entry-meta abbr,
    .entry-utility abbr {
    	border: none;
    }
    .entry-meta abbr:hover,
    .entry-utility abbr:hover {
    	border-bottom: 1px dotted #666;
    }
    .entry-content,
    .entry-summary {
    	clear: both;
    	padding: 12px 0 0 0;
    }
    #content .entry-summary p:last-child {
    	margin-bottom: 12px;
    }
    .entry-content fieldset {
    	border: 1px solid #e7e7e7;
    	margin: 0 0 24px 0;
    	padding: 24px;
    }
    .entry-content fieldset legend {
    	background: #fff;
    	color: #000;
    	font-weight: bold;
    	padding: 0 24px;
    }
    .entry-content input {
    	margin: 0 0 24px 0;
    }
    .entry-content input.file,
    .entry-content input.button {
    	margin-right: 24px;
    }
    .entry-content label {
    	color: #888;
    	font-size: 12px;
    }
    .entry-content select {
    	margin: 0 0 24px 0;
    }
    .entry-content sup,
    .entry-content sub {
    	font-size: 10px;
    }
    .entry-content blockquote.left {
    	float: left;
    	margin-left: 0;
    	margin-right: 24px;
    	text-align: right;
    	width: 33%;
    }
    .entry-content blockquote.right {
    	float: right;
    	margin-left: 24px;
    	margin-right: 0;
    	text-align: left;
    	width: 33%;
    }
    .page-link {
    	clear: both;
    	color: #000;
    	font-weight: bold;
    	margin: 0 0 22px 0;
    	word-spacing: 0.5em;
    }
    .page-link a:link,
    .page-link a:visited {
    	background: #f1f1f1;
    	color: #333;
    	font-weight: normal;
    	padding: 0.5em 0.75em;
    	text-decoration: none;
    }
    .home .sticky .page-link a {
    	background: #d9e8f7;
    }
    .page-link a:active,
    .page-link a:hover {
    	color: #ff4b33;
    }
    body.page .edit-link {
    	clear: both;
    	display: block;
    }
    #entry-author-info {
    	background: #f2f7fc;
    	border-top: 4px solid #000;
    	clear: both;
    	font-size: 14px;
    	line-height: 20px;
    	margin: 24px 0;
    	overflow: hidden;
    	padding: 18px 20px;
    }
    #entry-author-info #author-avatar {
    	background: #fff;
    	border: 1px solid #e7e7e7;
    	float: left;
    	height: 60px;
    	margin: 0 -104px 0 0;
    	padding: 11px;
    }
    #entry-author-info #author-description {
    	float: left;
    	margin: 0 0 0 104px;
    }
    #entry-author-info h2 {
    	color: #000;
    	font-size: 100%;
    	font-weight: bold;
    	margin-bottom: 0;
    }
    .entry-utility {
    	clear: both;
    	color: #888;
    	font-size: 12px;
    	line-height: 18px;
    }
    .entry-meta a,
    .entry-utility a {
    	color: #888;
    }
    .entry-meta a:hover,
    .entry-utility a:hover {
    	color: #ff4b33;
    }
    #content .video-player {
    	padding: 0;
    }

    Would appreciate any help!

  4. sheenp
    Member
    Posted 1 year ago #

    Hi Aaron!

    Thanks for your reply. What is the string I'm looking for. I do not know coding so I'm unsure what you're suggesting.

    Thank you again!
    Sheen

  5. WordPress Bum
    Member
    Posted 1 year ago #

    Try this.

    Appearance -> Editor

    On the right side select content.php

    Find

    <?php the_content( __( 'Continue Reading &rarr;', 'yoko' ) ); ?>

    replace with

    <?php the_excerpt( ); ?>

  6. sheenp
    Member
    Posted 1 year ago #

    Oh Aaron!

    I cannot thank you enough!! That did it. You are a genius.

    Thank you thank you thank you!!

    Sheen

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags