• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Cannot add continue reading to content post archive

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Cannot add continue reading to content post archive

This topic is: not resolved

Tagged: post format

  • This topic has 8 replies, 4 voices, and was last updated 8 years, 4 months ago by Carlo.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • January 5, 2015 at 1:11 pm #136125
    toddlohenry
    Member

    When I add these lines to the function.php file:

    //* Modify the Genesis content limit read more link
    add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    return '... [Continue Reading]';

    add_filter( 'excerpt_length', 'sp_excerpt_length' );
    function sp_excerpt_length( $length ) {
    return 50; // pull first 50 words
    }

    I get this:

    Parse error: syntax error, unexpected $end in /nas/wp/www/staging/vitalworklife/wp-content/themes/executive-pro/functions.php on line 227

    http://vitalworklife.staging.wpengine.com/news/blog/
    January 5, 2015 at 6:20 pm #136144
    Tonya
    Member

    Hi Todd,

    If the code is exactly how you have it above, you are missing the closing curly brace } after the function sp_read_more_link().

    Cheers,
    Tonya


    Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
    Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer Bootcamp

    January 7, 2015 at 12:50 pm #136298
    toddlohenry
    Member

    OK. Fair enough. So I went back and added it correctly...

    //* Modify the Genesis content limit read more link
    add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    return '... [Continue Reading]';
    }

    No results

    http://vitalworklife.staging.wpengine.com/news/blog/

    January 10, 2015 at 1:24 pm #136907
    toddlohenry
    Member

    Can I get an answer on this please?

    January 10, 2015 at 2:16 pm #136911
    Christoph
    Member

    Hi,

    the code you are using is to change the read more button when you are using the WordPress More Tag in the WordPress Editor to break a post on your site.

    To make it work on Archive pages you can try the following code:

    // Add Read More Link to Excerpts
    add_filter('excerpt_more', 'get_read_more_link');
    add_filter( 'the_content_more_link', 'get_read_more_link' );
    function get_read_more_link() {
       return '...&nbsp;<a href="' . get_permalink() . '">[Read&nbsp;More]</a>';
    }

    Props for this code snippet go to http://wpatch.com/how-to-add-a-read-more-link-to-genesis-child-theme-excerpts/


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    January 13, 2015 at 2:15 pm #137356
    toddlohenry
    Member

    Is the blog page an archive page? I need to know how to get [continue reading] to appear on a page of blog post excerpts. This should not be so difficult!

    January 13, 2015 at 2:30 pm #137357
    toddlohenry
    Member

    I copied and pasted the code exactly as you gave it to me. Nothing! See http://screencast.com/t/E6KNzc2yZ5

    January 13, 2015 at 3:51 pm #137363
    Christoph
    Member

    Sorry the code didn´t work for you.
    Is there a cache to flush on the wp-engine staging site?

    Ren Ventura just posted a collection of snippets to show/edit the read more link. Maybe one of those will do the trick for you.
    http://www.engagewp.com/customize-wordpress-read-more-link/


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    January 14, 2015 at 6:18 am #137423
    Carlo
    Member

    Hi there. I use similar code on my own site and it works. Try this:

    // Add Read More Link to Excerpts
    add_filter('excerpt_more', 'vwl_get_read_more_link', 20);
    function vwl_get_read_more_link( $default ) {
    	if ( is_admin() )
    		return $default;
    
    	return '&hellip;&nbsp;<a href="' . get_permalink() . '">[Continue&nbsp;Reading]</a>';
    }

    Are you sure you're pasting the code into the right theme?


    Comprehensive, easy to follow Genesis documentation

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble