Black Friday! Get up to 25% off GP Premium! Learn more ➝

[Resolved] Add read more for long sections on page.

Home Forums Support [Resolved] Add read more for long sections on page.

Home Forums Support Add read more for long sections on page.

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
  • #142492

    Hi. I’ve had a quick search and found almost but not quite the answer to my question.

    I’d like one page, with 3 sections, each section shows an excerpt which can be expanded / read more. The traditional read more html <!–more–> doesn’t do much, and the sections add on would remove an essential side bar.

    I’d like the read more function so the visitor can see the 3 sub headings on first visit, then find the relevant section.


    Would this function.php work for a page?

    add_filter( 'the_content_more_link', 'modify_read_more_link' );
    function modify_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
    Lead Developer
    Lead Developer

    I wonder if a plugin like this may do what you’re looking for?:


    Hi Tom. Thank you for the link, yes… something like that!
    However, I’ve some quirk in my system, I’ve disabled all but two plugins to check, everything works except…. any plugin that relates to collase/hide. [Although WP shortcode is working} – it has consumed much of my day.


    ok, I’m hair pulling… I switched themes to check, and these plugins work in other themes. So I stripped my child theme down to basics. Should I update my generate press?

    Lead Developer
    Lead Developer

    Keeping up to date with GP is always a good idea, but not being up to date shouldn’t break this.

    Can you link me to your site where you’re using the plugin? There might be a JS error somewhere I can spot 🙂


    Sorry for multiple posts… tried using GP not my child GP and all the plugins work. So, somehow it’s my childtheme, missing a java script or something. [All new to me this].


    I’d really appreciate the support (can be a lonely world!)
    most of site is private (does this make a difference to your enquiry?)
    I’ll make a page public, it has a mess of attempts to collapse/expand on

    wait a moment whilst I revert back to my child theme – again thank you sooooo much.

    Lead Developer
    Lead Developer

    Hmm, looks like there might be a PHP error somewhere stopping the site from printing out the footer area.

    Can you try #2 on this article and let me know if any errors appear?:


    Do I paste refine, false true etc into my child functions.php? Or set up a child wp_config.php ?

    Lead Developer
    Lead Developer

    Use your already existing wp-config.php.

    Does your footer area show up when your child theme isn’t activated?


    Everything is good when child theme not activated, all steady, the dashboard menu is visible across site, footer visible and the plugins work.
    p.s. no wp-config.php visible in GeneratePress theme editor.


    btw here is my style intro…

     Theme Name:   GeneratePress Child
     Theme URI:
     Description:  Child theme based on Generate Press
     Author:       Alice Mill
     Author URI:
     Template:     generatepress
     Version: 1.3.14
     Tags: two-columns, three-columns, one-column, right-sidebar, left-sidebar, fluid-layout, fixed-layout, responsive-layout, custom-header, custom-background, custom-menu, custom-colors, sticky-post, threaded-comments, translation-ready, featured-images, theme-options, light, white, dark, black, blue, brown, gray, green, orange, pink, purple, red, silver, tan, yellowLicense: GNU General Public License v2 or later
     Text Domain: generatepress-child

    my header is a copy of GP header
    my functions.php…

    <?php /*
      This file is part of a child theme called GeneratePress-child.
      Functions in this file will be loaded before the parent theme's functions.
      For more information, please read
      Add your own functions below this line.
      ========================================== */ 
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    function enqueue_parent_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );

    ok… I deleted a footer.php in my child. I thought I’d need it to personalise the copyright at the bottom. And… everything is sweet, beautiful, smelling of roses.


    Hi Alice. The wp-config.php file is in your root WP directory. You should be able to access it via cPanel or FTP. In your child theme functions.php file you don’t need to enqueue the parent style sheet. The theme automatically detects the child theme and enqueues both the parent and child style sheets.

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.