• Hi,

    I am displaying one post on homepage and I want it to display full,not excerpt. I made some changes in the category.php and my theme is Agama.

    After I made the changes, the homepage post did display in full, however, I see on category posts, they are also displaying in full content which I do not want. So, in brief, I want to display full content on homepage and excerpt on category pages.

    The part in bold in the code below in the theme, was “excerpt” before and I caned it to “content”.

    <?php if( !is_single() ): // If blog loop, show excerpt content ?>
    <?php the_content(); ?>

    <?php else: // Else if single post, show full content ?>

    <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘agama’ ) ); ?>
    <?php endif; ?>

    So, how to display excerpt only on category pages?

    Thnak you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter AJ20152015

    (@aj20152015)

    Correction: I changed the code above in content.php page NOT category.php

    try:

    <?php if( !is_single() && !is_home() ): // If anything other than blog loop or single, show excerpt content ?>
    <?php the_excerpt(); ?>
    
    <?php else: // Else if blog loop or single post, show full content ?>
    
    <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'agama' ) ); ?>
    <?php endif; ?>
    Thread Starter AJ20152015

    (@aj20152015)

    this is perfect. i did try something similar but it did not work, thank you so much…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display conents on homepage’ is closed to new replies.