Forums

Is there any way to have Javascript in the post title? (3 posts)

  1. myrko
    Member
    Posted 8 months ago #

    Is there any way to have Javascript in the post title in order to use if/else statements to output strings?

    I want to output £ for UK and $ for US in the post title on the same post (using Maxmind Javascript Geo).

    Thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Is there any way to have Javascript in the post title

    No.

  3. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Having given this some more thought, you might be able to write a function that grabbed wp_title() or similar, ran your javascript, then concatenated the appropriate symbol to the title and echoed the final value instead of wp_title() itself.

Reply

You must log in to post.

About this Topic