Forums

[resolved] Change 'Continue Reading' to image in TwentyTen (8 posts)

  1. AD7863
    Member
    Posted 1 year ago #

    Hello, I am using the latest version of WordPress on my blog and I would like to change the 'continue reading' text into an image but I don't know how to do it. Normally I'd do it on the main index template but this theme seems to be a bit different.

    Any help?

    Thanks

  2. Joseph
    Member
    Posted 1 year ago #

    The loop is in loop.php for TwentyTen theme.

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    it sounds like you know how to do it, just not where to find the code in Twenty Ten:

    this is in loop.php:

    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>

    there is also the 'read-more' for excerpts in functions.php:

    function twentyten_continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    }
  4. AD7863
    Member
    Posted 1 year ago #

    Yeah I think I can do it now, thanks alchymyth. =D

  5. AD7863
    Member
    Posted 1 year ago #

    OK so basically, this is what I've done so far:

    <?php the_content( __( '<a href="<?php echo get_permalink(); ?>"><img src="http://geekhang.com/wp-content/themes/twentyten/images/contread.gif" width="165" height="40" alt="Continue Reading..."></img></a>', 'twentyten' ) ); ?>

    When I put <?php echo get_permalink(); ?> in the href quotation marks, the image doesn't show up but when I remove it, the image shows up with a link to the homepage, how can I change this so it links to the post page or how it normally goes to the place on the post page where the continue read line thing was inserted.

    I hope you know what I mean lols :P

    Thanks

  6. Joseph
    Member
    Posted 1 year ago #

    You're passing <?php echo get_permalink(); ?> literally into the function.

    Try this:

    <?php the_content( __( '<a href="' . get_permalink() . '"><img src="http://geekhang.com/wp-content/themes/twentyten/images/contread.gif" width="165" height="40" alt="Continue Reading..."></img></a>', 'twentyten' ) ); ?>
  7. AD7863
    Member
    Posted 1 year ago #

    Hehe thanks, I'm not a PHP programmer you see. =D

    It worked perfectly though, thank you!

  8. Joseph
    Member
    Posted 1 year ago #

    You're welcome :)

Topic Closed

This topic has been closed to new replies.

About this Topic