Skip to content

Instantly share code, notes, and snippets.

View Fantikerz's full-sized avatar

Ryan Hamilton Fantikerz

View GitHub Profile
@chuckreynolds
chuckreynolds / wordpress-disable-image-attachment-page.php
Created May 8, 2013 19:14
How to Disable WordPress Image Attachment Pages. Note, Yoast SEO has this as an option under Permalinks but if you're not using that...
wp_redirect(get_permalink($post->post_parent));
@wolffe
wolffe / tinywp.php
Created April 14, 2013 09:24
Tiny WordPress (tinywp.php) is a quick PHP script which auto-installs WordPress on any host. Just upload it via FTP and run it.
<?php
$n = basename($_SERVER['SCRIPT_NAME']);
unlink($n);
copy('http://wordpress.org/latest.zip', 'wordpress.zip');
$b = new ZipArchive;
$b->open('wordpress.zip');
for($i = 0; $i < $b->numFiles; $i++) {
$f = $b->getNameIndex($i);
$b->renameName($f, str_replace('wordpress/', '', $f));
}