• 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

Moving "read more" link in archives to "genesis_after_entry_content"

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 › General Genesis Framework Discussions › Moving "read more" link in archives to "genesis_after_entry_content"

This topic is: resolved

Tagged: monochrome pro, read more link

  • This topic has 1 reply, 2 voices, and was last updated 10 months, 3 weeks ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 5, 2021 at 4:40 pm #504382
    spiezz
    Participant

    I'm using monochrome pro and know that the answer to my issue is somewhere in this code:
    /**
    * Modifies the generic more link markup for posts.
    *
    * @since 1.0.0
    *
    * @param string $output The current full HTML.
    * @param string $content The content HTML.
    * @param string $link The link HTML.
    * @return string The new more link HTML.
    */
    function monochrome_content_limit_read_more_markup( $output, $content, $link ) {

    $output = sprintf( '<p>%s</p> <p>%s</p>', $content, str_replace( '…', '', $link ) );

    return $output;

    }
    /**
    * Customize Read More Link
    * @author Bill Erickson
    * @link http://www.billerickson.net/read-more-link
    *
    * @param string
    * @return string
    */
    function be_more_link($more_link) {
    return sprintf('%s', get_permalink(), 'more +');
    }
    add_filter( 'excerpt_more', 'be_more_link' );
    add_filter( 'get_the_content_more_link', 'be_more_link', );
    add_filter( 'the_content_more_link', 'be_more_link', );

    I can see that I need to remove_action " whatever the more link action is called" and then add it back into genesis_after_entry_content.

    But what is the action called? Where can I find a reference for this? I have the hooks/filters plugin reference to show me where things go, but how can I find out what the actions are called?

    Thanks for pointing me in the right direction!

    August 6, 2021 at 5:36 am #504383
    Victor Font
    Moderator

    There's a difference between actions and filters. Bill's code is manipulating filters, which means the more link is being changed at the place in the Genesis code where the corresponding apply_filters function is installed. Filters always return content.

    Actions on the other hand, generally don't return content, but are used for executing one of more add_actions based on their priority in the corresponding do_action queue.

    Don't hold me to this, but I don't think the genesis_after_entry_content is going to work for the read more link. All the filters in Bill's code are called within the "loop". The loop is where post content is pulled from the database and prepared for display on the front end. I could be wrong about this, but I believe genesis_after_entry_content executes after the loop has completed. After the loop, the more link won't have access to the appropriate content. If you can get this to work, I'd be interest to know your result. It's not anything I would even try.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 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