WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Theme: Twenty Twelve] Removing the continue reading button (4 posts)

  1. travern
    Member
    Posted 1 year ago #

    Hi, i am trying to get the theme to only display the post title on the home page of the site.

    When you click the post title you will get the full post, but on the home page it will only show the post title. I have a childs theme and I have tried to alter the code in the contents.php, but when I do, it only removes everything below the blog post title in both the home page and when pressing the it.

    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    you could try using a conditional statement, possibly based on is_home():

    <?php if( !is_home() ) { ?>
    <div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    <?php } ?>
  3. travern
    Member
    Posted 1 year ago #

    Great! It worked. It removed everthing but the post title. Is there any way to just remove everythin after the "more-line"?

  4. travern
    Member
    Posted 1 year ago #

    Now i got it like i intenteded to. I just replaced the original code with this:

    <?php the_content( ( ' ' ) ); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic