• I wish to change loop-blog.php so that it shows the most recent post in full but every post after it as title only with no excerpt. My PHP is a bit weak and I am not sure the best way to go about it.

    // The following determines what the post format is and shows the correct file accordingly
    echo ‘<div class=”post_wrapper”>’;
    $format = get_post_format();
    get_template_part( ‘includes/post-formats/’.$format );
    if ($format == ”)
    get_template_part( ‘includes/post-formats/standard’ );
    echo ‘</div>’;
    endwhile; else: ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • look for the template file /includes/post-formats/standard.php and check the code in that file.

    what theme are you using?

    Thread Starter scturley

    (@scturley)

    The theme is a custom theme I purchased from Templatemonster, theme49627. It is a child theme using Cherry 3.1.5. The Standard.php is below.

    <article id=”post-<?php the_ID(); ?>” <?php post_class(‘post__holder’); ?>>
    <?php if(!is_singular()) : ?>
    <header class=”post-header”>
    <?php if(is_sticky()) : ?>
    <h5 class=”post-label”><?php echo theme_locals(“featured”);?></h5>
    <?php endif; ?>
    <h2 class=”post-title”>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
    </header>
    <?php endif; ?>
    <?php get_template_part(‘includes/post-formats/post-thumb’); ?>

    <?php if ( !is_singular() ) : ?>
    <!– Post Content –>
    <div class=”post_content”>
    <?php
    if (of_get_option(‘post_excerpt’)==”true” || of_get_option(‘post_excerpt’)==”) { ?>
    <div class=”excerpt”>
    <?php

    if (has_excerpt()) {
    the_excerpt();
    } else {
    if (!is_search()) {
    $content = get_the_content();
    echo apply_filters( ‘cherry_standard_post_content_list’, wp_trim_words( $content, 55 ) );
    } else {
    $excerpt = get_the_excerpt();
    echo apply_filters( ‘cherry_standard_post_content_search’, wp_trim_words( $excerpt, 55 ) );
    }
    } ?>
    </div>
    <?php }
    $button_text = of_get_option(‘blog_button_text’) ? apply_filters( ‘cherry_text_translate’, of_get_option(‘blog_button_text’), ‘blog_button_text’ ) : theme_locals(“read_more”) ;
    ?>
    ” class=”btn btn-primary”><?php echo $button_text; ?>
    <div class=”clear”></div>
    </div>

    <?php else :?>
    <!– Post Content –>
    <div class=”post_content”>
    <?php the_content(”); ?>
    <div class=”clear”></div>
    </div>
    <!– //Post Content –>
    <?php endif; ?>

    <?php get_template_part(‘includes/post-formats/post-meta’); ?>

    </article>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘change the way loop-blog.php displays posts’ is closed to new replies.