• Resolved ilmattiapascal

    (@ilmattiapascal)


    hi there!

    just a little question. Normally on my homepage i’ve also posts without any content but the post thumbnail (let’s take for example, only an image). I would like to create a rule on the content.php which could say: if there is no content (or excerpt) don’t echo read more.

    I’m not able to translate this sentence in php;

    thanks in advance!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • What theme are you using? Where did you download it from?

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    hi, thanks for the answer!

    sorry i forgoto to say the theme! it’s a twentytwelve child theme!

    <div class="entry-summary">
    			<?php the_excerpt(); ?>
    			<a href="<?php echo get_permalink(); ?>"> Read More...</a>
    
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<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 endif; ?>

    Which template file in your child theme is that code from?

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    from the content.php in the 2012’s child!

    Are you using the <!--more--> tag in your posts?

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    no sorry, i don’t know how to use that tag….are you able simply to tellme how to write the rules which can tells my code “if there’s no excerpts, don’t span read more button ?”

    i don’t know how to use that tag

    See customising the read more

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    thanks, at the end i was able to do it with the more tag; i changed the excerpt with the content() and put the tag in every post ! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘If there's no content i don't want read more button’ is closed to new replies.