StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Conditionally enable/disable header_scripts (http://www.studiopress.com/support/showthread.php?t=120088)

Paul_H 10-08-2012 10:54 AM

Conditionally enable/disable header_scripts
 
I've added my Google Analytics tracking code using the Genesis -> Theme Settings -> Header Script box on the admin page. What I would like to do is conditionally disable running the code I've entered into the Header Script box. The condition would be if the user is an authenticated user or not. The idea is to not track all of my own activity on the site when I'm logged in and creating and editing posts or adding new pages.

Is there a simple way to do this or do I need to take my tracking code out of Theme Settings -> Header Script and add a new action, conditionally, to wp_head, that adds the code?

Paul

Doak Heggeness 10-08-2012 11:03 AM

You could conditionally check if the user 'is_user_logged_in()' or base it on their their 'user level'.


All times are GMT -5. The time now is 03:51 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.