Skip to content

Instantly share code, notes, and snippets.

@nmec
nmec / fixmediaurls.sql
Created December 24, 2011 20:50
Fix media URLs after moving WordPress into a sub-directory: http://nmecdesign.com/?p=212
UPDATE wp_posts SET post_content = REPLACE(post_content, "YourWebsite.com/wp-content", "YourWebsite.com/wp/wp-content");
@nmec
nmec / no ga.js for wp-admin.phtml
Last active September 29, 2015 00:18
Checks if the current user if has admin privileges, otherwise load ga.js. Don't forget to change your Analytics ID. See http://nmecdesign.com/?p=57 for more info.
<?php if (current_user_can('manage_options')) { ?>
<a href="<?php echo admin_url(); ?>">Admin</a>
<?php } else { ?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-000000', 'auto');
@nmec
nmec / wpsc-default.css
Created August 23, 2011 23:13
WP e-Commerce default CSS. The horror, the horror.
/*
Theme Name: Default Theme
Theme URI: http://instinct.co.nz
Description: Default Theme
Version: 3.5
Author: Roy Ho
Author URI: http://instinct.co.nz
*/
/*