Site logo

Archived topic

Ways to change the text of various areas?

8 replies · Started by Michael on January 18, 2020

Viewing posts 1–9 of 9

Just wondering if there's an easy way (am probably overlooking something) to change things like when you click on a tag, it just shows the name of the tag and a bunch of posts underneath. It'd be nice if I could get it to say "posts tagged as <tag> " etc.

Another is on a single post, it would be nice to say "Posted by:" instead of "By" etc. There's probably more examples, is this an easy thing to do, or do I need functions or similar?

Hi there,

You can use filters for this.

For example:

add_filter( 'get_the_archive_title', function( $title ) {
    if ( is_tag() ) {
        return 'Posts tagged as ' . $title;
    }

    return $title;
}, 50 );

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
    if ( 'author' === $item ) {
        return 'Posted by: ';
    }

    return $output;
}, 50, 2 );

Let me know if you need more info :)

You guys are the best, there was a recent poll about peoples preference of theme in the Wordpress speed up facebook group. Generatepress came out top. Lots of good comments about support and the product itself.

Thanks Tom!

Damn, I closed that thread before I tested it, didn't work for me Tom ?

Neither of them worked? How did you add the functions?

Let me know :)

Neither, I added them to the code snippets plugin, use this for all custom functions.

Bingo !

That worked Tom, thanks very much.

You're welcome! :)

This archived topic is closed to new replies.