This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Example : | |
My Site : www.mysite.com (Site built in HTML) | |
My Blog : www.mysite.com/blog (Site built in WordPress) | |
Load Post on www.mysite.com from www.mysite.com/blog | |
Two types of solutions for Bug : NetworkError: 404 Not Found on Firebug | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Kill Trackbacks | |
Plugin URI: http://pmg.co/category/wordpress | |
Description: Kill all trackbacks on WordPress | |
Version: 1.0 | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOLUTIONS I have came across so far: | |
======================== SOLUTION 1 ==================== | |
In plugins (or somewhere) you probably have this code: | |
ini_set('zlib.output_compression', '1'); | |
so, I replaced that code with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* Suppose, you are browsing in your localhost | |
* http://localhost/myproject/index.php?id=8 | |
*/ | |
function getBaseUrl() | |
{ | |
// output: /myproject/index.php | |
$currentPath = $_SERVER['PHP_SELF']; | |
// output: Array ( [dirname] => /myproject [basename] => index.php [extension] => php [filename] => index ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#RewriteEngine On | |
#RewriteCond %{HTTP_HOST} ^site\.com$ [OR] | |
#RewriteCond %{HTTP_HOST} ^www\.site\.com$ | |
#RewriteCond %{REQUEST_URI} !^/folder/ | |
#RewriteRule (.*) /folder/$1 [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL : site.com/wp-admin/options-permalink.php | |
Change parameters to : | |
/%category%/%post_id%/%postname% | |
And Save | |
Voila! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^\.]+)$ $1.php [NC,L] | |
ErrorDocument 404 site/404.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Root directory 0755 | |
wp-admin 0755 | |
wp-content 0755 | |
wp-includes 0755 | |
.htaccess 0444 | |
readme.html 0400 | |
wp-config.php 0444 | |
wp-admin/index.php 0644 | |
wp-admin/.htaccess 0640 | |
wp-content/uploads 0757 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Categories for Pages | |
*/ | |
function categories_pages() { | |
// Add tag metabox to page | |
register_taxonomy_for_object_type('post_tag', 'page'); | |
// Add category metabox to page | |
register_taxonomy_for_object_type('category', 'page'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Excerpts for Pages | |
*/ | |
add_action( 'init', 'my_add_excerpts_to_pages' ); | |
function my_add_excerpts_to_pages() { | |
add_post_type_support( 'page', 'excerpt' ); | |
} | |
?> |