WordPress.org

Ready to get started?Download WordPress

Forums

Using a variable stored in a cookie to change the output of certain content (1 post)

  1. Peadig
    Member
    Posted 2 years ago #

    Here's my position - I am building a site that I want to be able to show a specific phone number depending on how they arrive to the site. At the moment I have made a script to store a cookie if the visitor lands on a certain page. That cookie can then be used to do whatever I want.

    What I want to do now is have a variable called $phone and change it if the cookie is enabled. However, I am not 100% on what I should do with the phone number as it appears. Currently it's a normal number manually entered both within posts, pages, widgets and plugins. I want to be able to have the site output $phone wherever it appears.

    Any suggestions here?

Topic Closed

This topic has been closed to new replies.

About this Topic