• Hello

    Please look at he url.
    I am using theme Astrid from Athemes
    As you see all the posts are showed in brief.
    I would like the newest post, which is showed on top of the post list, to be showed fully opened and not brief.
    The other posts in the list I want to be shown in brief

    So again….the newest post should display in full.

    Can someone help me with this ?

    Thank you so much

    Petter

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hello there,

    Edit the template-parts/content.php in child theme mode.

    Then replace this code block:

    
    <?php if ( is_single() ) : ?>
    <div class="entry-content">
    	<?php the_content(); ?>
    </div>
    <?php else : ?>
    <div class="entry-summary">
    	<?php the_excerpt(); ?>
    </div>
    <div class="read-more clearfix">
    	<a class="button post-button" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php esc_html_e('Read more', 'astrid'); ?></a>
    </div>
    <?php endif; ?>
    

    with:

    
    <?php
    $index = $wp_query->current_post + 1;
    ?>
    <?php if ( is_single() ) : ?>
    <div class="entry-content">
    	<?php the_content(); ?>
    </div>
    <?php elseif ( $index == 1 && !is_single() ) : ?>
    <div class="entry-content">
    	<?php the_content(); ?>
    </div>
    <?php else : ?>
    <div class="entry-summary">
    	<?php the_excerpt(); ?>
    </div>
    <div class="read-more clearfix">
    	<a class="button post-button" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php esc_html_e('Read more', 'astrid'); ?></a>
    </div>
    <?php endif; ?>
    

    In the code above,

    
    $index = $wp_query->current_post + 1;
    

    variable get the post count within loop.

    
    elseif ( $index == 1 && !is_single() ) :
    

    check if the post is the latest and display special output if it isn’t single post.

    Regards,
    Kharis

Viewing 1 replies (of 1 total)

The topic ‘Please help me someone’ is closed to new replies.