Support

Account

Home Forums Feature Requests Link Read More button to ACF Reply To: Link Read More button to ACF

  • 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:
    https://developer.wordpress.org/reference/hooks/the_content_more_link/

    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.