[Resolved] Ways to change the text of various areas?

Home Forums Support [Resolved] Ways to change the text of various areas?

Home Forums Support Ways to change the text of various areas?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1136139
    Michael

    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?

    #1136471
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #1136692
    Michael

    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!

    #1136695
    Michael

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

    #1137034
    Tom
    Lead Developer
    Lead Developer

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

    Let me know πŸ™‚

    #1137148
    Michael

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

    #1137325
    Tom
    Lead Developer
    Lead Developer
    #1137788
    Michael

    Bingo !

    That worked Tom, thanks very much.

    #1138236
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

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