Setting Cookies With Wordpress

by 2 replies
4
I need to be able to set cookies on specific pages. And redirects based on those cookies on other pages.

Does anyone know of a plugin that can do this?

Or does anyone have any other solutions?

Is there a way to put PHP code in the head of a page without having to edit the page template?


Thanks
#programming #cookies #setting #wordpress
  • There are various ways to do this. The way I do this would be to set the link up on the first page to point to another page within your site. The code for the second page would be as follows

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="XHTML namespace">
    <head>
    <meta http-equiv="Refresh" content="1; URL=http://youraffiliatelink" />
    <title>place the name of the product here</title>
    </head>
    </html>
  • The problem is I'm working in Wordpress. I don't have direct access to the head section (unless I make a template for each page I need to set a cookie, and that just isn't practical).

Next Topics on Trending Feed