Display different css or Information based on previous page

I've run into a bit of a tricky problem that I'm probably over thinking. I need to be able to display different css depending on what campaign page the user has come from.

To better illustrate:

Campaign 1 \
Campaign 2 ---- Information or css  ---- page
Campaign 3 /

I hope this is understandable.

Topic previous css Wordpress

Category Web


WordPress has a function called wp_get_referer() that you could use to do this. Codex link

$page_referrer = wp_get_referer();
if ( $page_referrer == 'campaign-1-url') {
    // Campaign 1 css
}

You'll have to craft the conditional statement to fit yours needs.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.