I've got a menu, once the user clicks any food selection, I wish to drive them towards the same page, but I wish to style the page in a different way with respect to the food selection...for ex: alter the background color to become different. What's the easiest method to do that? I believed that after they click a food selection, a flexible could be set or perhaps a session variable could be set.

Can there be an simpler method of doing this? Does Wordpress have anything included in the architecture to create this easy?

  1. you need to make your page like a wordpress template ( if you didn't produced already ) ( see this )
  2. you're right using the session variable. pass the variable to that particular page and process it there. there's a little of programming involved...

I don't are conscious of one other way for doing that which you request.

Avoid using the session with this. Since HTTP is really a stateless protocol, you need to stay away from session towards the finest measures possible. Because the user is hitting a hyperlink, it only is sensible making that link convey the data you are after. ust pass data you would like within the URL, e.g. like a a question string parameter

You'll be able to just query with this within the page template like so:

  Template Name: Varying Background Color Template

  $bgcolor = $_GET['bgcolor'];

  switch ($bgcolor) {
    case 1:
      // Change the background to color 1

    case 2:
      // Change the background to color 2

    case 3:
      // Change the background to color 3

If you feel query string parameters are ugly, you should use path info rather, but this involves you to produce a special situation rewrite rule which makes the road info "invisible" to WordPress therefore it does not think it is the slug of the page. Whether you would like or need this is dependent how your permalink configuration in WordPress is.