WordPress.org

Ready to get started?Download WordPress

Forums

TwentyEleven Continue Reading (14 posts)

  1. noeladams
    Member
    Posted 3 years ago #

    I have been reading for about 2 hours now and everything I try i am unable to remove the continue reading function on TwentyEleven theme. I found a demo of the them here: http://twentyelevendemo.wordpress.com/ and it is working correctly.

    Anyone help?

    Noel.

  2. lulubell138
    Member
    Posted 3 years ago #

    i wish i could help you but how did you get the margin so small between header and content? http://cheaptshirtsfast.com/

  3. noeladams
    Member
    Posted 3 years ago #

    look here:

  4. noeladams
    Member
    Posted 3 years ago #

    anyone have a idea?

  5. Mrmark
    Member
    Posted 3 years ago #

    You might try the codex about the 'read more' link.

    I've been trying to customize my own 'continue reading' link in my child theme's content.php using the "get_the_title" function in the codex with no success.

    The key bit seems to be here:
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    It comes a few lines after the </header><!-- .entry-header --> bit.

    I've inserted the get_the_title function to return a result like "continue reading [post title]" (with the template's little nav arrow) intact but whatever changes I make in my content.php aren't reflected in the front end. When I botch the code I do get an error, though; I just can't seem to affect the 'continue reading' text.

    I've even tried mucking with it in the parent theme's content.php. Is it called from some other doc? Any help will be appreciated...especially a code snipped that would show how to insert the get_the_title function, which I would EXPECT to read like this:

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

    Thanks!

  6. alchymyth
    Forum Moderator
    Posted 3 years ago #

    @Mrmark
    you are working with a string and already within a php tag - so, no extra php tags;

    try:

    <?php the_content( __( 'Continue reading [' . get_the_title($post->ID) . '] <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>

    there is a similar example in here: http://codex.wordpress.org/Function_Reference/the_content#Include_Title_in_.22More.22

  7. alchymyth
    Forum Moderator
    Posted 3 years ago #

    @noeladams

    where do you want to 'remove the continue reading function'?

    on posts with a 'more tag' on the front page?

    or on the excerpts in search results?

  8. Mrmark
    Member
    Posted 3 years ago #

    Tnanks @alchymyth. I saw that tip when reading about the <more> tag, and tried to implement it myself...but wasn't clear enough how to insert the example code in the actual statement in content.php. Not knowing php I tripped myself up.

    So I inserted this code but still see the default 'Continue reading' behavior. No post titles. Can I append the code? I checked that the content.php is in the child theme.

    Thanks in advance if you have the opportunity.

    On an unrelated quick question, in Twenty Eleven, I've applied a background color to post titles (<class "entry-title"> which looks great, but wanted to have a rollover highlight (brighter color). Naturally I though I could style .entry-title a:hover with a background color but of course it ends with the link text - not the whole bar as I'd hoped. I want the whole <entry-title> element to have hover behavior. No go, eh?

    OK - enough!

    </header><!-- .entry-header -->
    <?php global $more; if( $wp_query->current_post <= 2 && !is_paged() ) { $more = -1; } else { $more = 1; }  ?>
    		<?php if ( is_search() || $wp_query->current_post > 2 || is_paged() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    		<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    <?php the_content( __( 'Continue reading [' . get_the_title($post->ID) . '] <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>',  'after' => '</div>' ) ); ?>
    
    		</div><!-- .entry-content -->
    		<?php endif; ?>
  9. clovis
    Member
    Posted 2 years ago #

    When the search results come up on my site, at the end of the excerpts there is the text: "continue reading" which I want to change to something else.
    I'm using twentyeleven theme with a child theme. Is it possible to change this text simply by putting something in the style.css in my child theme folder? (rather than putting a php file in the child theme folder and tweaking as above). Thanks! (and apologies if this is a stupid question!)

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    Please post a new topic.

  11. clovis
    Member
    Posted 2 years ago #

    Sorry! I thought it was the same topic as the first poster! (I'm a complete beginner)

  12. Mrmark
    Member
    Posted 2 years ago #

    @clovis, the functionality comes from the php, which composes the page. The CSS styles it - which means you can change the color, font, etc., incl. making it disappear ('display:none') but you can't change the text.
    I never did figure out why I couldn't make it work as I wanted it to.

    BTW, when you put a php in your child theme (very handy) you only add to it the function you want - not replicate the whole parent functions.php in the child theme folder. Future reference.

  13. clovis
    Member
    Posted 2 years ago #

    @Mrmark Aha, thanks! :)

  14. AWN
    Member
    Posted 2 years ago #

    Hi everybody,
    I also have a problem with this function,

    I am using a plugin called "polylang" for bilingual (English & Persian) purpose, in English I don't have any problem, but in Persian this link (Continue reading) is still in English and I want to add translation of this link in Persian as well.

    Please help me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.