• Resolved clever_name

    (@clever_name)


    Hello ??

    I have been researching the forums on how to achieve this but haven’t found one addressing my exact situation (or maybe I’m having trouble implementing it).

    I am using the Twenty Sixteen theme and my child theme is named The Daily Dose Child.
    Here is the site:
    https://dailydose.rankubator.com/

    Thank you for any help, I’ve been working on this for weeks and am coming here in hopes that someone can point me in the right direction.

    What I want to do:

    Home Page

    Display only the most recent post – full post

    ( I can achieve this by selecting “your latest posts” under “Front page displays” then ensuring “Blog pages show at most” 1 posts. )

    The problem with this is that when I go to a category page or an archive page, it also displays only one post with the full post displayed and not the excerpts in a list format.

    Category / Archive Pages

    When a user clicks on a category such as “football” I want a page to return a list of all of the posts in that category but only the excerpt with a thumbnail, not the entire post. I would like to do the same exact thing for the archive links as well.

    ( I have read that you can change a line of code from the_content to the_excerpt but I do not know which file to look for or how to change in the twenty sixteen theme.)

    The solutions I find are mainly, copy the content of one template file, paste into another then update your customizer settings to show “summary” vs “full text”. This solution hasn’t helped me as it will change this for ALL the pages/posts. I want to keep the main page with just the most recent post, then have excerpts with thumbs as the results for any category or archive selection.

    Thank you ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • hi@ clever_name

    For the category/archive page issue
    please go to content-single.php inside templates-parts folder you could find the_content on line 22 over there,repalce that with the_excerpt.

    Thanks

    Thread Starter clever_name

    (@clever_name)

    Hi tsuzan and thank you for your speedy reply.

    Unfortunately, this doesn’t solve my problem.

    Updating the content-single.php file does return an excerpt on a single post page like this:

    Single Post

    I still want single posts to display the content of the post on single pages, not the excerpts.

    As you can see, the category and archive pages still show the full content here:

    Category
    OR THIS
    Archive

    I want to instead show a list of excerpts of posts in that respective category or archive, not the full post content like it currently does.

    Any ideas on how to achieve this?

    Thank you for your help!

    Thread Starter clever_name

    (@clever_name)

    I’ve been looking through the files for the_content and see a lot of the_post has this syntax changed?

    Everywhere I look has the “easy” solution of changing “the_content” to “the_excerpt” in the loop. This is the loop I keep finding on all of my pages. Am I missing something?

    <?php
    			// Start the Loop.
    			while ( have_posts() ) : the_post();
    
    				/*
    				 * Include the Post-Format-specific template for the content.
    				 * If you want to override this in a child theme, then include a file
    				 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    				 */
    				get_template_part( 'template-parts/content', get_post_format() );
    
    			// End the loop.
    			endwhile;
    Thread Starter clever_name

    (@clever_name)

    I found this article:

    https://daext.com/display-the-excerpt-in-the-twenty-sixteen-homepage-and-archive-pages/

    Using this method I am able to show excerpts on all of my post controlled pages:

    front page or homepage
    archive pages
    category pages

    This is great, now I need to show JUST THE 1st most recent post FULL CONTENT on the homepage/front page. I cannot do this in customizer as it changes the amount of post excerpts also. I need the post excerpts to show 6 per page and the homepage to show the content and only 1 post. I hope this makes sense.

    Can anyone help with this?

    Thread Starter clever_name

    (@clever_name)

    In case anyone is trying to do this here is my final step!

    So I used the steps in my prior post linking to that article about showing just the excerpts. THEN:

    Create a page template front-page.php

    <?php
    /*
    Template Name: Homepage
    */
    ?>
    
    <?get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    <?php
     $postslist = get_posts('numberposts=1');
     foreach ($postslist as $post) :
        setup_postdata($post);
     ?>
            <div class="post"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content() ?>
    </div>
    <?php endforeach ?>
    
    		</main><!-- .site-main -->
    	</div><!-- .content-area -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Switch in Reading Settings to use a static FrontPage and select this template.

    Thread Starter clever_name

    (@clever_name)

    Resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Most recent post home page and only excerpts w/thumb on category / archive’ is closed to new replies.