Skip to content

Instantly share code, notes, and snippets.

View randyzwitch's full-sized avatar

Randy Zwitch randyzwitch

View GitHub Profile
@randyzwitch
randyzwitch / powered-by-wordpress-3.php
Created June 1, 2013 18:12
Removing Powered By WordPress, Part 3
<div id="site-generator">
<!-- <?php do_action( 'twentyeleven_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyeleven' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyeleven' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'twentyeleven' ), 'WordPress' ); ?></a> -->
© Randy Zwitch - 2011
</div>
@randyzwitch
randyzwitch / ga-admin.php
Created June 1, 2013 18:19
Modifying Google Analytics to not track logged in WordPress users
<?php
if ( is_user_logged_in() ) {
} else {
}
?>
@randyzwitch
randyzwitch / ga-admin-2.php
Created June 1, 2013 18:20
Modifying Google Analytics to not track logged in users, Part 2
<?php
if ( is_user_logged_in() ) {
} else {
<script type="text/javascript">
var _gaq =_gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
@randyzwitch
randyzwitch / ga-admin-3.php
Created June 1, 2013 18:21
Modifying Google Analytics to not track logged in WordPress users, part 3
<?php
if ( is_user_logged_in() ) {
} else {
echo "<script type='text/javascript' src='http://yourdomain.com/your_ga_code_filename.js'></script>";
}
?>
@randyzwitch
randyzwitch / gplus.js
Created June 1, 2013 18:25
Google Plus snippet
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</body>
@randyzwitch
randyzwitch / gplus-2.js
Created June 1, 2013 18:26
Google Plus snippet 2
<div class="entry-content">
<!-- Place this tag where you want the +1 button to render -->
<g:plusone href="<?php the_permalink(); ?>"></g:plusone>
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
@randyzwitch
randyzwitch / gplus.php
Created June 1, 2013 18:26
Google Plus 3
<h1 class="entry-title"><?php the_title(); ?></h1>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone href="<?php the_permalink(); ?>"></g:plusone>
<?php if ( 'post' == get_post_type() ) : ?>
@randyzwitch
randyzwitch / wp.php
Created June 1, 2013 18:31
More wordpress code changes
<footer class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
@randyzwitch
randyzwitch / wordpress-remove.php
Created June 1, 2013 18:32
Removing more WordPress code
<!-- <?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( '' != $tag_list ) {
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
} elseif ( '' != $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
@randyzwitch
randyzwitch / remove.php
Created June 1, 2013 18:33
Removing even more WordPress code examples
/* if ( '' != $tag_list ) {
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s by %5$s. Bookmark the permalink.', 'twentyeleven' );
} elseif ( '' != $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s by %5$s. Bookmark the permalink.', 'twentyeleven' );
} else {
$utility_text = __( 'This entry was posted by %5$s. Bookmark the permalink.', 'twentyeleven' );
}
*/