Log in or Register

Excerpts "Read More" not showing

Home Forums Twenty Plus Pro and Lite Excerpts "Read More" not showing

This topic contains 15 replies, has 2 voices, and was last updated by  Zeaks 1 month ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #8965

    Jay Daniels
    Member

    Zeaks,

    Would this code with the tics prevent the “…Read More” from showing in the excerpt post?

    <a href=”‘ . get_permalink($post->ID) . ‘”>Read more</a></span>’;

    If I remove the tics, it freezes up when trying to update the functions.php. I have tried everything and now am just blank about what I have and haven’t done. I installed a new fresh copy of Twenty Plus Pro so I know my core files are good. I tried the code several times in the CSS Editor but nothing happens. I tried the Advanced Excerpts plugin but that doesn’t work either so I deactivated it. Thanks.

    #8966

    Jay Daniels
    Member

    Zeaks, I notice the following functions.php code says:’$excerpt = preg_replace(” (\[.*?\])”,”,$excerpt);’ (beginning ‘ and ending ‘ are my insert for this post)

    Presently, the excerpt cuts off in the middle of a sentence and doesn’t include the [.*?\] or what I was used to seeing as [...] at the end of the excerpt so the code above would seem to look for the instance of [.*?\] to replace with “Read more” link. Am I wrong about this thought? What can I do to fix this. Presently I am holding off on all new posts until I can get this resolved so I am following behind at http://roundhousetalk.com. Thanks Zeaks.

     

    #8968

    Zeaks
    Key Master

    The excerpt code for the blog post sis as follows.

    // Blog posts excerpt
    function get_the_post_excerpt(){
    	$excerpt = get_the_content();
    	$excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
    	$excerpt = strip_shortcodes($excerpt);
    	$excerpt = strip_tags($excerpt);
    	$excerpt = substr($excerpt, 0, 220); // change this to whatever you like
    	$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
    	$excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
    	$excerpt = '<p>'.$excerpt.' ... <span class="excerpt-read-more"><a href="' . get_permalink($post- rel="nofollow">ID) . '">Read more</a></span>';
    return $excerpt;
    }

    The excerpt should end with “Read More” you can change that to whatever you want in the last line.

    If you want to increase the length of the excerpt, change the number in the 5th line 220 to something else. Excerpts can not tell when a sentence ends, they display a certain number of letters.

    Excerpts strip links p tags and html from the post, this is nothing unusual with Twenty Plus, it’s how excerpts normally work.

    If youw ant to modify the excerpt there are discussions on that on the old forums and throughout this site, search for “Live links in excerpts” on the old forums.


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #8979

    Jay Daniels
    Member

    Sorry Zeaks. I placed the excerpt code in my child theme css and the function.php and nothing happened. It worked perfectly in Twenty Twelve. Is there a way to force it? Getting desperate.

    #8983

    Jay Daniels
    Member

    Ok Zeaks, here is where I am at. At http://roundhousetalk.com, you can see my first post has a “Read more…” link at the end. This is exactly what I want.

    However, if you look at the second article, Indianz.Com > BIA superintendent out of office amid Osage drilling issues, at the end of the excerpt on the front page does not have a “Read more…” link.

    I compared both posts to make sure they were identical. I created them both at the same time within 10 minutes of each one. In the “Screen Options” at the top of the edit post page, each post has identical checked features (excerpts is checked).

    Looking at the text rather than visual edit, the code or snippets are alike in use and structure. What gives?

    #8985

    Zeaks
    Key Master

    Sorry Zeaks. I placed the excerpt code in my child theme css and the function.php and nothing happened. It worked perfectly in Twenty Twelve. Is there a way to force it? Getting desperate.

    If you’ve changed the code, I would suggest reverting it back to the original and removing whatever you’ve added. Twenty Plus displays excerpts if the option is set in Appearance > Theme Options > Post Layout.

    The theme will display excerpts and the Read more link just like on the site I linked.

    I can’t offer much help if you’ve modified the code and haven’t disabled your plugins to troubleshoot the issue.


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #8987

    Jay Daniels
    Member

    Zeaks, I can remove all of Twenty Plus Pro including the directories and the child theme, and then reinstall a fresh clean start. That would probably be the easiest.

    Just one question. Does Twenty Plus Pro utilize the theme Twenty Twelve at all? I know that Twenty Plus Lite did (I think) so if Twenty Plus Pro uses any files from Twenty Twelve, would any code be used in the Twenty Plus Pro? If so, I could also remove Twenty Twelve and install a fresh copy as well. Once you advise, I will proceed to start over. Thanks.

    #8988

    Zeaks
    Key Master

    Yes, both Lite and Pro are child themes of Twenty Twelve, so Twenty Twelve is needed. If youw ant to be safe, delete twenty twelve and twenty plus pro then reinstall both.

    If the read more link is still not working, it’s a plugin cause the problem. There’s nothing special with the way it uses excerpts so there’s no reason for any plugin to be causing issues, once you find out which one it is contact the author.

    I suspect it’s the related posts plugin


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #8993

    Jay Daniels
    Member

    Ok, I deleted Twenty Twelve, Twenty Plus Pro, Twenty Plus Lite, Twenty Plus Pro Child, and Twenty Plus Lite Child themes.

    Reinstalled Twenty Twelve (no child) and Twenty Plus Pro (no child yet). I went to Appearance/Theme Options and selected “Excerpts” from the drop down menu and saved. Went to http://roundhousetalk.com and still no excerpt with the “read more” link at the end of the excerpt. Also, if I removed the above themes entirely, all of my widgets are still intact in the right sidebar even though I haven’t set them up. Would the theme remember how I set them up even when I deleted and removed all of those themes?

    #8994

    Zeaks
    Key Master

    Yes WordPress remembers your configuration on a theme per theme basis. I noticed you said (no child) for Twenty Plus, you don’t need to create a child theme for it (if that’s what you meant) it is a child theme.

    Have you tried it with your plugins deactivated yet?


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #9000

    Jay Daniels
    Member

    I’ve got about 50 total plugins. Do I deactivate all 50 or only certain ones?

    #9002

    Zeaks
    Key Master

    I would start with whatever plugin is adding the related posts to your articles, since that’s changing the way the posts are displayed.

    If you don’t want to mess with the plugins on your live site, you can create a test site, then install the same plugins on that instead.


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #9006

    Jay Daniels
    Member

    So far so good. Now the [...] shows up where the “Read more…” should eventually appear. I recall in my many attempts that there is a code that converts that box into the “Read more…”  I’m only saying “Read more…” because that’s standard as it can be changed to any wording as a link.

    #9008

    Zeaks
    Key Master

    It should display a read more link just like it does on http://twentyten.info if it’s not, there’s something wrong. You should not need to do anything but set the post format to excerpts in theme options.

    If you haven’t troubleshooted with plugins deactivated, at least on a test site, I suggest you do, it’s very difficult to figure things like this out when there’s plugins (50 you said) that could be causing the issue still active.


    Before asking a question please use the search, or check out some popular posts.
    Change twenty Eleven sidebar width
    Create a WordPress child theme
    Create excerpts in twenty Twelve
    If I’ve helped you with something, click the “Rate this post” button.

    #9012

    Jay Daniels
    Member

    Zeaks, still haven’t figured how to resolve this. I did install my Related Posts plugin now and there is no change in the appearance of the front page except that the related posts are underneath where they were before I started having the excerpt issue. So it doesn’t appear that it conflicts with the excerpt showing a “Read more…” link at the end of the excerpt. I did look at the old forum, tried to insert the ‘add_filter(‘the_excerpt’, ‘make_clickable’);’ (tics were included I just added to show the script to you) and nothing happened. I’m totally lost. It has to be something between twenty twelve and twenty plus because it functioned perfectly when I used the Twenty Plus Lite theme. What next?

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.

Log in or Register