• 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

Allow Read More tag on specific pages

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 › Allow Read More tag on specific pages

This topic is: resolved

Tagged: more

  • This topic has 1 reply, 1 voice, and was last updated 9 years, 4 months ago by blackartz.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 7, 2013 at 2:46 am #65618
    blackartz
    Member

    The more tag will not work on single pages, because is_page is true. It only works on archive and blog pages and it is core WordPress functionality.

    I'm trying to get the content splitting, read more tag <!--more--> to function on two specific additional landing pages I've built. They have widgeted areas and I'm using the Genesis Featured Widget Amplified plugin to pull in posts from specific categories. The excerpts work fine, but when I select the full 'Show Content' option within the widget, each post's entire
    content is displayed, instead of being split at the <!--more--> tag.

    I've been trying to write a function filter like this:


    //* allow read more link on News page.
    add_filter( 'the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    if ( is_page('news')) {
    $more = ‘1’;

    }}

    But its not working for me. Any help would be much appreciated!

    October 7, 2013 at 4:29 am #65629
    blackartz
    Member

    OK solved this myself 🙂

    In case anyone is interested, I just needed to turn off the code which denies the use of the <!–more–> tag, directly before the wiget area I've added to my new page, then turn it back on again after the widget area.

    So for each of my new pages I just wrapped the <div> which contains the new widget thus:

    <?php global $more; $more = FALSE; ?><!-- allow Read More tag -->
    <div id="widget-wrapping">
    <?php if (!dynamic_sidebar('Widget Area on New Page')) : ?>
    <?php endif; ?>
    </div><!-- end #widget-wrapping -->
    <?php $more = TRUE; ?><!-- turn off Read More tag -->

    Obviously the content for lines 2,3,4 and 5 will be different for you, but those first and last lines will allow you to use the read more tag just the way you can on the index and archive pages.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Allow Read More tag on specific pages’ is closed to new 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