WordPress.org

Support

Support » Themes and Templates » [Resolved] [Theme: Twenty Twelve] Removing the continue reading button

[Resolved] [Theme: Twenty Twelve] Removing the continue reading button

  • 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 -->
Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    @alchymyth

    Forum Moderator

    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 } ?>

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

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

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Theme: Twenty Twelve] Removing the continue reading button’ is closed to new replies.
Skip to toolbar