• adnanoner

    (@adnanoner)


    Hi everybody,

    I want to change the_title (my posts h2 title) of a page according to conditions. I’ve got a checkoutpage with a post-title that’s called “confirm your checkout”. But if the basket is empty I want it to display “Your basket is empty”. Is there a way to modify the_title from a plugin?

    I was thinking about a specific filter but then there is no way to check if the cart is empty or not

    function assignPageTitle(){
      return "Title goes here";
    }
    add_filter('wp_title', 'assignPageTitle');

    So I think it’s easier to edit the_title from within the plugin?

    Cheers,
    Adnan

    [ Please do not bump, it’s not permitted here. ]

  • The topic ‘Change the_title outsite of header.php’ is closed to new replies.