[Resolved] Styling Read on Link

Home Forums Support [Resolved] Styling Read on Link

Home Forums Support Styling Read on Link

  • This topic has 3 replies, 2 voices, and was last updated 6 years ago by Leo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #554693
    Robert

    I’d like to style the link and hover colors for my excerpt’s “Read on” link independent of the Content colors in Customizer. Basically, I’d like to use brown for the link color and blue for the hover. In the post content, I have that reversed because the brown recedes within the body of text.

    I’m currently using the following snippet to create the “Read on” link following my post excerpts on the front page:

    //* Changing excerpt more - only works where excerpt IS hand-crafted
      
    function manual_excerpt_more( $excerpt ) {
    	$excerpt_more = '';
    	if( has_excerpt() ) {
        	$excerpt_more = '&nbsp;<a href="' . get_permalink() . '" rel="nofollow"><strong><p>Read on &rarr;</p></strong></a>';
    	}
    	return $excerpt . $excerpt_more;
    }
    add_filter( 'get_the_excerpt', 'manual_excerpt_more' );

    As always, your help is greatly appreciated.

    #554932
    Leo
    Staff
    Customer Support

    Hi there,

    Try this CSS:

    .entry-summary a {
        color: #000;
    }
    .entry-summary a:hover {
        color: #fff;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #554955
    Robert

    Perfect! Thank you.

    #555289
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.