qui_gon_jim
Forum Replies Created
-
Forum: Plugins
In reply to: [Display Widgets] Custom Taxonomies Not Available As Checkable ItemsHi, I appear to be having the same problem when adding another taxonomy to posts. There is no option to select taxonomies within the widget (like there is for Categories +/-), therefore I am unable to get a widget to display on the taxonomy pages. Any ideas?
register_taxonomy('topic','post',array( 'hierarchical' => true, 'labels' => array( 'name' => 'Topics', 'singular_name' => 'Topic', 'search_items' => 'Search Topics', 'all_items' => 'All Topics', 'parent_item' => 'Parent Topic', 'parent_item_colon' => 'Topic Location', 'edit_item' => 'Edit Topic', 'update_item' => 'Update Topic', 'add_new_item' => 'Add New Topic', 'new_item_name' => 'New Topic Name', 'menu_name' => 'Topics', ), 'rewrite' => array( 'slug' => 'news/topic', 'with_front' => false, 'hierarchical' => true ), ));
Good point, that was using the default manual Civic UK code at the time. You could use this instead.
function ccAddAnalytics() { jQuery.getScript(('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js', function() { var GATracker = _gat._createTracker('<?php echo $cookiecontrol_settings['gakey']; ?>'); GATracker._trackPageview(); }); }
Suprised this has not been sorted yet. I flagged it up in a post a few months ago that the Google Analytics code was not executing, and posted a change to the cookiecontrol.php file which sorted it out. It looks like the latest update to this plugin, which added some features, stopped it working. Maybe the author is no longer supporting.
In the cookiecontrol.php file I changed the following code:
<script type="text/javascript"> jQuery(document).ready(function() { cookieControl({ introText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['introText']); ?> <a href='<?php echo $privacy; ?>'>Privacy Policy.</a></p>", fullText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['fullText']); ?></p>", position:'<?php echo $cookiecontrol_settings['position']; ?>', shape:'<?php echo $cookiecontrol_settings['shape']; ?>', theme:'<?php echo $cookiecontrol_settings['theme']; ?>', startOpen:<?php echo $cookiecontrol_startopen; ?>, autoHide:<?php echo $cookiecontrol_timeout; ?>, subdomains:'<?php echo $cookiecontrol_settings['subdomains']; ?>', consentModel:'<?php echo $cookiecontrol_settings['consentmodel']; ?>', onAccept:function(){<?php echo $cookiecontrol_settings['onaccept']; ?>}, onReady:function(){<?php echo $cookiecontrol_settings['onready']; ?>}, onCookiesAllowed:function(){<?php echo $cookiecontrol_settings['cookiesallowed']; ?>}, onCookiesNotAllowed:function(){<?php echo $cookiecontrol_settings['cookiesnotallowed']; ?>}, countries:'<?php echo $cookiecontrol_settings['countries']; ?>' }); }); function ccAddAnalytics(){ var _gaq = _gaq || []; _gaq.push(['_setAccount', '<?php echo $cookiecontrol_settings['gakey']; ?>']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); }; </script>
To this code:
<script type="text/javascript"> //<![CDATA[ cookieControl({ introText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['introText']); ?> <a href='<?php echo $privacy; ?>'>Privacy Policy.</a></p>", fullText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['fullText']); ?></p>", position:'<?php echo $cookiecontrol_settings['position']; ?>', shape:'<?php echo $cookiecontrol_settings['shape']; ?>', theme:'<?php echo $cookiecontrol_settings['theme']; ?>', startOpen:<?php echo $cookiecontrol_startopen; ?>, autoHide:<?php echo $cookiecontrol_timeout; ?>, subdomains:'<?php echo $cookiecontrol_settings['subdomains']; ?>', consentModel:'<?php echo $cookiecontrol_settings['consentmodel']; ?>', onAccept:function(){<?php echo $cookiecontrol_settings['onaccept']; ?>}, onReady:function(){<?php echo $cookiecontrol_settings['onready']; ?>}, onCookiesAllowed:function(){<?php echo $cookiecontrol_settings['cookiesallowed']; ?>}, onCookiesNotAllowed:function(){<?php echo $cookiecontrol_settings['cookiesnotallowed']; ?>}, countries:'<?php echo $cookiecontrol_settings['countries']; ?>' }); function ccAddAnalytics() { jQuery.getScript("https://www.google-analytics.com/ga.js", function() { var GATracker = _gat._createTracker('<?php echo $cookiecontrol_settings['gakey']; ?>'); GATracker._trackPageview(); }); } //]]> </script>
The above code is the same as what Civic UK use for their manual installation.
Forum: Plugins
In reply to: [Cookie Control] [Plugin: Cookie Control] JavaScriptSorry, the code I changed it to was this, the code above had my analytics ID hard coded!
<script type="text/javascript"> //<![CDATA[ cookieControl({ introText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['introText']); ?> <a href='<?php echo $privacy; ?>'>Privacy Policy.</a></p>", fullText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['fullText']); ?></p>", position:'<?php echo $cookiecontrol_settings['position']; ?>', shape:'<?php echo $cookiecontrol_settings['shape']; ?>', theme:'<?php echo $cookiecontrol_settings['theme']; ?>', startOpen:<?php echo $cookiecontrol_startopen; ?>, autoHide:<?php echo $cookiecontrol_timeout; ?>, subdomains:'<?php echo $cookiecontrol_settings['subdomains']; ?>', consentModel:'<?php echo $cookiecontrol_settings['consentmodel']; ?>', onAccept:function(){<?php echo $cookiecontrol_settings['onaccept']; ?>}, onReady:function(){<?php echo $cookiecontrol_settings['onready']; ?>}, onCookiesAllowed:function(){<?php echo $cookiecontrol_settings['cookiesallowed']; ?>}, onCookiesNotAllowed:function(){<?php echo $cookiecontrol_settings['cookiesnotallowed']; ?>}, countries:'<?php echo $cookiecontrol_settings['countries']; ?>' }); function ccAddAnalytics() { jQuery.getScript("https://www.google-analytics.com/ga.js", function() { var GATracker = _gat._createTracker('<?php echo $cookiecontrol_settings['gakey']; ?>'); GATracker._trackPageview(); }); } //]]> </script>
Forum: Plugins
In reply to: [Cookie Control] [Plugin: Cookie Control] JavaScript[ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]
Modified to this which is inline with manual code:
<script type="text/javascript"> //<![CDATA[ cookieControl({ introText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['introText']); ?> <a>'>Privacy Policy.</a></p>", fullText:"<p><?php echo sanitize_text_field($cookiecontrol_settings['fullText']); ?></p>", position:'<?php echo $cookiecontrol_settings['position']; ?>', shape:'<?php echo $cookiecontrol_settings['shape']; ?>', theme:'<?php echo $cookiecontrol_settings['theme']; ?>', startOpen:<?php echo $cookiecontrol_startopen; ?>, autoHide:<?php echo $cookiecontrol_timeout; ?>, subdomains:'<?php echo $cookiecontrol_settings['subdomains']; ?>', consentModel:'<?php echo $cookiecontrol_settings['consentmodel']; ?>', onAccept:function(){<?php echo $cookiecontrol_settings['onaccept']; ?>}, onReady:function(){<?php echo $cookiecontrol_settings['onready']; ?>}, onCookiesAllowed:function(){<?php echo $cookiecontrol_settings['cookiesallowed']; ?>}, onCookiesNotAllowed:function(){<?php echo $cookiecontrol_settings['cookiesnotallowed']; ?>}, countries:'<?php echo $cookiecontrol_settings['countries']; ?>' }); function ccAddAnalytics() { jQuery.getScript("https://www.google-analytics.com/ga.js", function() { var GATracker = _gat._createTracker('UA-717581-15'); GATracker._trackPageview(); }); } //]]> </script>
Forum: Plugins
In reply to: [Cookie Control] [Plugin: Cookie Control] JavaScriptIt is currently:
<script type=”text/javascript”>
jQuery(document).ready(function() {
cookieControl({
introText:”<p><?php echo sanitize_text_field($cookiecontrol_settings[‘introText’]); ?> ‘>Privacy Policy.</p>”,
fullText:”<p><?php echo sanitize_text_field($cookiecontrol_settings[‘fullText’]); ?></p>”,
position:'<?php echo $cookiecontrol_settings[‘position’]; ?>’,
shape:'<?php echo $cookiecontrol_settings[‘shape’]; ?>’,
theme:'<?php echo $cookiecontrol_settings[‘theme’]; ?>’,
startOpen:<?php echo $cookiecontrol_startopen; ?>,
autoHide:<?php echo $cookiecontrol_timeout; ?>,
subdomains:'<?php echo $cookiecontrol_settings[‘subdomains’]; ?>’,
consentModel:'<?php echo $cookiecontrol_settings[‘consentmodel’]; ?>’,
onAccept:function(){<?php echo $cookiecontrol_settings[‘onaccept’]; ?>},
onReady:function(){<?php echo $cookiecontrol_settings[‘onready’]; ?>},
onCookiesAllowed:function(){<?php echo $cookiecontrol_settings[‘cookiesallowed’]; ?>},
onCookiesNotAllowed:function(){<?php echo $cookiecontrol_settings[‘cookiesnotallowed’]; ?>},
countries:'<?php echo $cookiecontrol_settings[‘countries’]; ?>’
});
});function ccAddAnalytics(){
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘<?php echo $cookiecontrol_settings[‘gakey’]; ?>’]);
_gaq.push([‘_trackPageview’]);(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘https://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
};
</script>