Site logo

[Resolved] Assistance With Different Footer Text For Posts / Pages

Home Forums Support [Resolved] Assistance With Different Footer Text For Posts / Pages

Home Forums Support Assistance With Different Footer Text For Posts / Pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2406260
    Marty

    Hi there, sorry to bug you guys again but unfortunately I cannot seem to find a solution to this.

    I’d like to no longer use only the site-wide text footer located in Customizing ▸ Layout ▸ Footer ▸ Copyright but rather:

    • “Text A” on [x] pages (pretty much all pages actually)
    • “Text B” (affiliate etc. text) on [x] posts.

    I’ve created footer Layout elements but with no success – I can’t seem to affect the text in the footer itself – it’s either above it, below it, or something else. I’ve tried shortcodes also in the footer to use with test text, and that didn’t work either.

    Regardless of what I do, it’s always the default copyright & GeneratePress text in the footer. Perhaps I missed something somewhere? Thank you very much.

    #2406609
    David
    Staff
    Customer Support

    Hi there,

    will Text B in addition to Text A ?

    #2407989
    Marty

    Hi David. It wasn’t my first wish but if necessary it can be. It would be better if not, honestly though.

    #2408077
    David
    Staff
    Customer Support

    Thats fine, we have options.
    Try adding this PHP Snippet tom change the text for the Pages:

    add_filter( 'generate_copyright', function( $copy ) {
        if ( is_page() ) {
            $copy = sprintf ('© %1$s %2$s',
                date('Y'),
                'your pages copyright message'
            );
        }
        return $copy;
    } );
    #2409355
    Marty

    Wonderful, thanks David! Works great and I can modify it to extend it to certain posts and/or pages based on categories:

    in_category('best-donut-makers') etc. 🙂

    #2409696
    David
    Staff
    Customer Support

    Awesome – glad to be of help 🙂

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