WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] My theme doesn't have the_content() (4 posts)

  1. george_gaz
    Member
    Posted 2 years ago #

    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: http://fthemes.com/pressweek-free-wordpress-theme/

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try looking in loop-homepage.php or loop.php.

  3. Lisa Sabin-Wilson
    Member
    Posted 2 years ago #

    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: http://codex.wordpress.org/Function_Reference/get_template_part ... introduced in version 3.0, it's pretty nifty!

    Hope that helps!

  4. george_gaz
    Member
    Posted 2 years ago #

    Perfect!

    It was in loop.php.

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.