Support » Fixing WordPress » […] links

  • I have recently replaced a Genesis theme on my client’s website with Divi. All has generally gone well, but the listings by category have lost the link at the end of the exerpt. The … shows but without an associated link.
    I have worked out how to create my own [Read more] tag using css
    =====================================
    article.et_pb_post::after {
    content: ” [Read more]”;
    }
    ==========================
    but I can’t work out how to make this link to the whole article in the same way that the title does, or the original … did.
    I’m sure this must be possible. Please can anyone help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The typical way to do something like this would be to hook a function onto the excerpt_more filter:

    function skd_read_more( $more ) {
      global $post;
    
      $read_more = sprintf( '<a href="%s">Read More...</a>', esc_url( get_permalink()  ) );
      return $read_more;
    }
    add_filter( 'excerpt_more', 'skd_read_more' );
    Thread Starter hooperman13

    (@hooperman13)

    Thanks Stephen,
    I REALLY need to get up to speed on php, functions.php, and hooks, ‘cos I’m really struggling to know what to do with what you’ve given me.
    Is the code snippet complete, or just and example of what it might look like?
    I assume it needs to go in the functions.php file, but do I need to do something else as well to make it active?

    Really appreciate your help, sorry to be so dum.

    Paul

    You could use that code snippet exactly as I wrote it. I’m not 100% familiar with how Divi works, but as long as it doesn’t do anything too funky with WordPress’ core functions, you should be able to drop the snippet directly into your theme’s functions.php and it should work without you having to do anything else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[…] links’ is closed to new replies.