i have created page from wp-admin and i have added that page in to menu. and it’s displaying in my website also..
now my question is i want to call pop() function of javascript something like this onclick=”pop(). i don’t have any idea how to do it.
i have different 5 menus(pages) but i want to add function only for this menu(page)..
i have searched in google also but didn’t get any idea or help.
can you please help me?
Thanks in advance..
You can check body classess.
By default, wordpress assignes classes to the body to indetify pages/posts
So for example page with ID 155 will have body class page-id-155
Then you can check with jQuery
You can trigger Js files only on certain post using the $post variable.
Here is a sample of how you can implement this in your function.php :