Change Continue Reading text to css button / image

Community Forums Forums Design Tips and Tricks Change Continue Reading text to css button / image

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Hard Boiled Greg 1 year, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18194

    francky
    Participant
    Post count: 41

    I am using Metro Theme and would want to replace the  [Continue Reading] to a CSS BUTTON or IMAGE.

    How can I do this? I have searched the forums but couldn’t find the solution.

    Thank you in advance.

    #18291

    Hard Boiled Greg
    Participant
    Post count: 88

    Hi,

    You can add this code to your functions.php file:

    [php]/** Modify the Genesis content limit read more link */
    add_filter( ‘get_the_content_more_link’, ‘custom_read_more_link’ );
    function custom_read_more_link() {
    return ‘… <a class="more-link" href="’ . get_permalink() . ‘"><img src="image-link-here"></a>’;
    }[/php]

    adding the location of your button image to the img src=

    Also the link has a class of “more-link” so your could style it’s background with a CSS gradient for a button effect instead.

    Hard Boiled Greg


    Website: Hard Boiled Greg Twitter: @hbgreg

    #18394

    francky
    Participant
    Post count: 41

    Thank you Greg!

    Unfortunately that code was bringing some errors and I was lucky enough to get the following code which worked fine.

    <code>

    /** Modify the Genesis content limit read more link */
    add_filter( ‘excerpt_more’, ‘child_read_more_link’ );
    add_filter( ‘get_the_content_more_link’, ‘child_read_more_link’ );
    add_filter( ‘the_content_more_link’, ‘child_read_more_link’ );
    function child_read_more_link() {
    return ‘…<a class=”more-link” href=”‘ . get_permalink() . ‘”><img src=”image-link-here”></a>’;
    }

    </code>

    #18395

    Hard Boiled Greg
    Participant
    Post count: 88

    I tested it before I posted it, but I’m glad you got it resolved.

    Take care,

    Greg


    Website: Hard Boiled Greg Twitter: @hbgreg

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

You must be logged in to reply to this topic.