Problem with change "Read more" to custom text

Hi, I’d like to change “Read more” text to my custom text: “Sprawdź szczegóły”. I’ve already searched for it on the forum and I found e.g. this Change read more text.

So I added this piece of code in the end of functions.php in /wp-content/themes/pro-child directory:

function new_excerpt_more($more) {
    $stack = x_get_stack();

    if ( $stack == 'integrity' ) {
      return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Sprawdź szczegóły', '__x__' ) . '</a></div>';
    } else if ( $stack == 'renew' ) {
      return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Sprawdź szczegóły', '__x__' ) . '</a>';
    }
}
add_filter('excerpt_more', 'new_excerpt_more');

As you can see, I’ve changed Read more to Sprawdź szczegóły.

Nothing changed. There’s still “Read more” there.

I use PRO child theme.

What am I doing wrong?

Hi Rafal,

Thanks for reaching out.

You can also check this thread Article - Read More - button where I help one of our customers on how to change the read more text button.

Only if none of that helps, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Oh, it works now. Maybe I should’ve included conditions for all stacks, not only for two of them?

Anyway, thanks! :slight_smile:

Hi @rafaluk,

I guess the 2nd function is the missing piece of your code.

You’re welcome and it’s our pleasure to help you. If you have any other concerns, feel free to reach us.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.