Home Forums Feature Requests Link Read More button to ACF


Link Read More button to ACF

  • Hey!

    Not sure if this is possible in ACF so thought I’d make a post..

    It would be awesome if you could link the standard WordPress ‘Read More’ button to an advanced custom field to input a custom web address for every individual post!

    Would this need to be included in an update or maybe it’s possible already I don’t know!


  • Let me sure I understand, because the default WP behavior is to link the ‘read more’ to the individual Post already….but you want to override this and have it link elsewhere?

    If that’s what you want, you can do this easily with a short code snippet in either your Theme’s functions.php file (perfect if you have a Child Theme) or a custom plugin file if you’re not using a Child Theme so that it doesn’t get overwritten with Theme updates.

    There is a WP hook called “the_content_more_link” which you can read about here:

    SO in your case you’d setup a custom field to contain this link (there are several to choose from but you could just use the URL field under the Basic section) and have that field appear on all Posts.

    Then your code that goes in your functions.php or custom plugin would be something like this:

    function modify_read_more_link() {
     $morelink = get_field('whateveryourfieldnameis');
     return '<a class="more-link" href="' . $morelink . '">Read More...</a>';
    add_filter( 'the_content_more_link', 'modify_read_more_link' );

    You can change the verbiage (Read More…) to whatever you want, but most readers know what ‘read more’ means so I suggest keeping it simple.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Link Read More button to ACF’ is closed to new replies.