• Resolved george_gaz

    (@george_gaz)


    Hello,

    I am using a theme that doesn’t appear to have the_content() in the index.php. As a result it is displaying the full post on the home page which now goes on for ages (long posts).

    I just want to display excerpts but cannot do it as there is no the_content() to replace with the_excerpt() ?

    The index.php reads:

    <?php get_template_part('content', 'before'); ?>
    
        <div class="content">
    
            <?php get_template_part('loop', 'homepage'); ?> 
    
        </div><!-- .content -->
    
    <?php get_template_part('content', 'after'); ?>

    Grateful for any assisstance.

    Here is the theme: https://fthemes.com/pressweek-free-wordpress-theme/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try looking in loop-homepage.php or loop.php.

    Hi George –

    Based on the code you provided, the index.php is making a call to 1, or 2, files that probably contain the tag you’re looking for (the_content)

    This line in your index.php:
    <?php get_template_part('loop', 'homepage'); ?>

    is making a call to include one of two template files within your theme:
    – loop.php
    – loop-homepage.php (probably handles the display of posts on your homepage)

    If you have a peek inside your theme folder, you will most likely find either one (or both) of those files, and can make your edits there.

    Note: strongly recommend making a backup of all the files in your current theme folder before you attempt making changes…nice to have that backup as a failsafe!

    2nd Note: read up on the get_template_part(); tag in the Codex here: https://codex.www.ads-software.com/Function_Reference/get_template_part … introduced in version 3.0, it’s pretty nifty!

    Hope that helps!

    Thread Starter george_gaz

    (@george_gaz)

    Perfect!

    It was in loop.php.

    Thank you for your help, the homepage looks much better now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘My theme doesn't have the_content()’ is closed to new replies.