• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Change the "read more" button text for certain categories only?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Change the "read more" button text for certain categories only?

This topic is: not resolved

Tagged: read more

  • This topic has 12 replies, 3 voices, and was last updated 8 years, 4 months ago by Paul.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • August 29, 2017 at 1:27 am #210848
    Paul
    Participant

    Hi All,

    Is there a way to change the "read more" button (text) in certain categories?

    I am aware of how to change the "read more" button (text) in all results (pages, posts etc), but is there a way to change what is says (the text) for certain categories only?

    If yes, could you also let me know where to put the code?

    Thanks guys 🙂

    August 29, 2017 at 2:58 am #210849
    Brad Dalton
    Participant

    Yes, use the code with a conditional tag.

    These code snippets may help


    Tutorials for StudioPress Themes.

    August 29, 2017 at 4:23 am #210851
    Paul
    Participant

    Thanks for your fast reply, appreciate that. Here is the code I currently have, I'm not quite sure where to edit it, are you able to help to the point where I can just change the category id numbers?

    /** Customize Read More Text */
    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 'VIEW FULL PROFILE';
    }

    August 29, 2017 at 4:33 am #210852
    Brad Dalton
    Participant

    You need to add the conditional tag. If you look at the page i linked to, it includes example with conditional tags so you can learn where to put the conditional.


    Tutorials for StudioPress Themes.

    August 29, 2017 at 4:39 am #210853
    Paul
    Participant

    Thanks, I did have a look but I'm not sure where to add the conditional tag to the above code 🙁

    August 29, 2017 at 6:56 am #210858
    Erika
    Participant

    Hi Paul,

    Here is code that already has the snippets Brad suggested inserted. Simply replace the bold text with your own.

    //* Modify read more link
    add_filter( 'get_the_content_more_link', 'THEMENAME_read_more_link' );
    function THEMENAME_read_more_link() {
    if ( is_category( 'Stinky Cheeses' ) ) {
    return '... Text Here »';
    }
    if ( is_category( 'Stinky Cheeses' ) ) {
    return '... Text Here »';
    }
    }

    August 29, 2017 at 6:57 am #210859
    Erika
    Participant

    And also edit the "Text Here" text that became a link 🙂 Copy and paste each "if" section entirely for more variances if needed.

    August 29, 2017 at 7:18 am #210864
    Brad Dalton
    Participant

    This works however you will need to change the category slug in the code https://wpsites.net/web-design/change-read-more-text-conditionally/


    Tutorials for StudioPress Themes.

    August 29, 2017 at 7:47 pm #210893
    Paul
    Participant

    Thanks Erika, that looked pretty straight forward until Brad added his extra comment. With this in mind, should the code still look like your code above Erika? Or should more be added?

    Apologies Brad, I am struggling with your directions, but I am grateful for your offers of help.

    I just need the entire code all in one paste please if possible?

    August 29, 2017 at 8:16 pm #210894
    Erika
    Participant

    Paul,

    Go ahead and try my code as is, making the adjustments I recommended. I tested the code on one of my sites and it works.

    August 31, 2017 at 5:25 pm #210997
    Paul
    Participant

    Hi Erika,

    Thanks again for your help. I just have a few more questions if that's okay?

    - Where do I copy the code? (I put it in my functions.php but it crashed the site, I had to FTP upload a previous version of the file to get the site up again).

    - Does the code need to sit in a particular place within the file?

    - I am using the genesis child theme "Metro Pro Theme", do I need to change the THEMENAME to the child theme "Metro Pro Theme", or the genesis theme?

    - If it is the Metro Pro Theme, do I change the text like this? Metro Pro Theme, OR like this, Metro-Pro-Theme, OR like this Metro_Pro_Theme?

    Sorry for all the questions and I appreciate your help 🙂

    Paul.

    August 31, 2017 at 5:43 pm #210998
    Erika
    Participant

    Paul,

    I think I know why your site crashed. If you contact me through my site listed below, I can send you the code. Part of the code is a link, and this forum converts it into the blue "Text Here" seen above. You need the link part of it to make the code work and not crash the site.

    August 31, 2017 at 6:41 pm #211006
    Paul
    Participant
    This reply has been marked as private.
  • Author
    Posts
Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble