[Resolved] Change displayed page title (without changing menu titles)

Home Forums Support [Resolved] Change displayed page title (without changing menu titles)

Home Forums Support Change displayed page title (without changing menu titles)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1608168
    Randy

    Hi,
    I thought this would be easy, but maybe I’m overlooking something? When I try to use add_filter(‘the_title’) to change a static page title on the fly with php, it also changes menu titles.

    This person came up with the answer here: https://wordpress.stackexchange.com/questions/309151/apply-the-title-filter-in-post-page-title-but-not-in-menu-title#answers

    But wanted to check if all of that is necessary or if there’s another generate hook I could use (I saw generate_get_the_title_parameters but couldn’t determine that would work)

    Thank you!

    #1608201
    David
    Staff
    Customer Support

    Hi there,

    see Toms answer here:

    https://generatepress.com/forums/topic/change-page-title-programmatically/#post-1377184

    The alternative being something like the code you found on Stackoverflow

    #1608460
    Randy

    Cool! Thought I’d check. Was able to make it work with the stackoverflow approach, as convoluted as it seems 😉

    #1608515
    David
    Staff
    Customer Support

    Yes the_title() element is a pain – as it is used in may places throughout WP and Plugins.

    Glad to hear you got it working.

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