add_action( ‘admin_enqueue_scripts’, ‘admin_enqueue_scripts_example’ ); function admin_enqueue_scripts_example( $hook ) { if( ‘edit.php’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, plugin_dir_url( __FILE__ ) . ‘myscript.js’ ); }
WordPress
WordPress Images Linking to Themselves
I’m sure it’s happened to you. You’re checking out someone’s website. It looks good. Nice images. Oh, this one’s a link! I wonder where it goes? Oh. It’s the same picture I was just looking at, only now it’s the only thing on the damn page. I don’t like it either, but it’s easy to […]
Simple Post Ordering +1 for Jake!
I absolutely love this plugin! I’m putting the faq here for my own use, but if anyone else reads this, I highly recommend this plugin. [hr][hr] Why can’t I reorder my posts? Generic posts are not displayed by menu order – they’re displayed by chronology. You can theoretically add menu ordering to posts in your […]
Canvas Avatars – rounded to square
Haven’t had a chance to try this yet. Just thought I’d put it here for future reference. #post-author .profile-image img, #comments .avatar img { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; }
Fixing/Enabling WordPress Permalinks on Ubuntu/Apache
Apache Settings Enable rewrite module: ~$ sudo a2enmod rewrite Edit Apache configuration file: (I only have one site enabled) ~$ vim /etc/apache2/sites-enabled/000-default Change AllowOverride None to AllowOverride All Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Restart Apache: ~$ sudo service apache2 restart WordPress Settings Settings -> Permalinks Enable your desired permalinks […]
$wpdb::prepare()
I thought $wpdb->prepare() had been working for me. I really did. What I hadn’t realized, or taken the time to learn, was that prepare() functions similarly to printf(), taking placeholders for arguments provided after the query that is being prepared, i.e. $wpdb->prepare(“SELECT * FROM table_name WHERE id = %d AND title = %s SORT BY […]