php - Wordpress: check if last visited page was homepage? -


i'm new wordpress, , need on php bit. on wordpress pages (let's call page a), want call jquery animation, only if visitor clicked wordpress home page page a.

so clear, how can call jquery animation on page given that previous page homepage?

i wanted use is_home() test page visitor came from. far understand, is_home() can used test if current page homepage.

is there way around this?

you can use history object has back method , can check if returns url of homepage

the other option use cookies on pages

$.cookie("previouspage", window.location.href, {path:"/"}); 

and check on pagea

if($.cookie("previouspage") == 'yourhomepage') {    //call animation } 

notice: $.cookie available if use jquery cookie plugin can found here

useful links:


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -