StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 10-08-2012, 10:54 AM
Paul_H Paul_H is offline
Registered User
Genesis Member
 
Join Date: Sep 2011
Posts: 3
Default 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
  #2  
Old 10-08-2012, 11:03 AM
Doak Heggeness Doak Heggeness is offline
Registered User
Pro Plus Member
 
Join Date: Mar 2011
Location: Oregon
Posts: 242
Default

You could conditionally check if the user 'is_user_logged_in()' or base it on their their 'user level'.
__________________
Wordpress Development - Mobile Themes | www.wordpressphp.net
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add 2nd Subnav Bar - Conditionally? angiemel General Discussion 2 05-21-2010 07:27 PM


All times are GMT -5. The time now is 11:09 PM.

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