Defining the cookie stuff:
define(‘ADMIN_COOKIE_PATH’, ‘/’);
define(‘COOKIE_DOMAIN’, ”);
define(‘COOKIEPATH’, ”);
define(‘SITECOOKIEPATH’, ”);
Worked for me too – 2.7, with multiple domains and blogs.
Here’s how to clear your browser cache without going into your menus. This applies to Firefox, Internet Explorer, Safari and Chrome.
Note: CSS changes can cause a really sticky cache when background images are changed, they tend not to update unless you clear your cache.
If you press and hold the “Shift” key while you hit the “Enter” key it the WordPress editor will give you the secret next line instead of the new paragraph!
If you simply hit the “Enter” or “Return” key on your keyboard it will create a new paragraph.
from: http://codex.wordpress.org/Resetting_Your_Password
Begin by logging into phpMyAdmin and click databases.
A client reported that WordPress with Contact Form 7 lost his contact form database after upgrading WP from version 2.x to version 3.
The author of Contact Form 7 has now updated his code so that the form is fully compatible with WP v3.
In case the upgrades don’t go smoothly:
I’d copy the actual contact form code into text files before upgrading WP. Then upgrade contact form 7, then see if they dissappear. In that case I’d paste them back in to the desired form from scratch an
To create paragraph spaces in TinyMCE or <p> </p> tinymce wordpress:
A WordPress style is <p><br “class=spacer_” /></p>, however this is not in my stylesheet, it comes from using TinyMCE advanced as an editor plugin in the backend.
A quick way to do it is:
<p> </p>
but this will give full line height spaces between paragraphs.
I use this instead because I can adjust the line-height, thus distance between the paragraphs:
In the code:
<p class="spacer"> </p>
In the stylesheet:
.spacer {
line-height: 0.7em; }
My WordPress theme didn’t have a 404.php page included and I wanted to make any error 404 “page not found” go to the home page. This method would go to any page you specify. This is a somewhat hard coded solution and it is a permanent redirect in this case.
Contents of 404.php:
<?php
header("Status: 301 Moved Permanently");
header("Location:http://www.mywebsite.com");
?>
This depends upon your specific template. Custom page and post templates can be defined merely by putting them up on the website in the Theme’s folder with the title “content.php” which overrides wp-content.php.
The Default Template for my Blog pages is “Single.php” based on the inove template.
A new template can be created for pages (not posts) by creating it (or copying the code from something like “archive.php”, uploading it to the server and then selecting it in the dropdown menu “Template” on the page edit screen. This can be done for posts if you use the plugin “Custom Post Templates”.
WordPress’ wonderful plugin Contact Form 7 has not supported loading a Thank You page after the user clicks Submit. (As of Aug. 2009)
Here is a way to force Contact Form 7 to load a custom page after the user submits the form:
(note that it will change the submit form results for every contact form on the website, until code is added to the javascript to handle multiple Contact Forms on one WordPress website)
Edit this file: /wp-content/plugins/contact-form-7/contact-form-7.js
line: 91 add one line here, immediately after the code:
if (1 == data.mailSent) {
add this:
location.href="http://mywebsite/my-thank-you-page/";
Here’s a great WP website that has a compatibility chart of various plugins with various versions of WordPress:
WordPress Plugin Compatibility Check
If your WP login redirects to a different installation of WordPress and you cannot log in to the correct wp-admin:
In my case it was a matter of exporting a blog from WPMU to a stand alone blog on another server to replicate the entire wordpress installation with all of the posts and pages intact.
Apparently it exported the blog address. I could access the wordpress blog as a user, but couldn’t login as the admin.
Another time I changed the Admin->Settings->General->”Wordpress address (URL)” from a domain name to an IP/directory which threw it into a tizzy. Every time I tried to log in to it would redirect me. No way to fix this in WordPress Admin panel.
This fixed it:
Edit the WordPress Database on the server you’d like to login to. Find out by looking at your /wp-config.php file. Then using Cpanel then PHPMyAdmin, open the database and go to the table wp_options->option_name and the value is the blog that it’s redirecting to!
Change this value to the WP install that you’d like to log in to, even using http://174.34.141.10/~myaccount if you have to.
If this doesn’t actually finish a successful login, and it did make the redirect go to the proper blog, but the redirect is still there it could be caused by a config file, not the database.
Alternatively, this may help:
Defining the cookie stuff:
define(‘ADMIN_COOKIE_PATH’, ‘/’);
define(‘COOKIE_DOMAIN’, ”);
define(‘COOKIEPATH’, ”);
define(‘SITECOOKIEPATH’, ”);
Worked for me too – 2.7, with multiple domains and blogs.
You can use the kitchen sink editor and have your styles appear in the “Styles” drop down directly in the page editor.
http://www.laptoptips.ca/projects/tinymce-advanced/
After you install the plugin, it’ll put a new button on the wp admin toolbar where you can configure stuff. Drag the new ‘styles’ dropdown to the tinymce toolbar, add new styles to the css file in the plugin directory, Ctrl + F5 to get everything to reload, and there you have it. If the style does not show up, dump your browser cache, then reload.
From: WordPress Security Tips and Hacks.
Ten security tips for WordPress.
Everything you wanted to know about designing Header Images in WordPress but were afraid to ask.
Even changing header images
To change the default image upload folder:
In the file: /wp-settings.php
define( "UPLOADS", "wp-content/blogs.dir/{$wpdb->blogid}/files/" );
When the problem remains that you have the uploaded files going into a /year/month subdirectory, there is a checkbox in the Admin->Settings for not using the year date. However if you are using WordPress MU and you always want the uploads to not be deeply nested in a bewildering array of year/month folders, you can override this setting for all of your MU blogs by editing your /functions.php file to ignore the “uploads_use_yearmonth_folders” setting by modifying line 1855 (MU version 2.7)
from: if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
to: if ( get_option( '' ) ) {
How to tell which upload directory your individual blog in WordPress MU is in:The /wp-includes/blogs.dir/ directory contains lots of numbered folders like 11, to determine which blog this folder belongs to go to your database and find the table for wp_blogs and this one will cross reference the blog names with the respective numbers.
About file uploads From a WordPress forum comment by a user sacredpath on:
When creating and uploading an image to wordpress.com here are some basics worth remembering:
(1) Be sure your image is one of these file types – jpg, jpeg, png, gif (Note that bmp’s cannot be uploaded due to size).
(2) Do not use anything in the file name except letters and numbers. Use no spaces, no dashes, no underscores, or any type of special character or punctuation, except for the dot between the file name and the extension. Also make sure that the file name has an extension.
(3) If you are using iPhoto, then use the “export” function under the file menu to export the image to your desktop before trying to upload it to WordPress.
(4) If you are not using the image in thumbnail size, make sure that the image is not too wide for the post area in your particular theme. You can find maximum image widths for the most popular themes here: http://faq.wordpress.com/2006/09/25/how-big-can-my-images-be/
(5) Optimize your images so that your blog pages will load faster. See http://faq.wordpress.com/2006/05/08/optimise-your-images/
(6) How to upload pictures in posts: http://faq.wordpress.com/2006/07/16/how-do-i-upload-pictures/
(7) How do I get text to go around a picture? http://faq.wordpress.com/2006/05/29/how-do-i-get-text-to-go-around-a-picture/
(8) How do I upload larger pictures? How to increase the file size limit on uploads with WordPress.
There are several limits that you need to change before you can upload a large image file to WordPress for file uploads:
2) PHP interpreter code changes or modifications to get PHP to accept the large file size uploads.
3) Apache mime type not set right for file upload.
4) WordPress itself which has a default upload file size of 10Mb. This is for WordPress MU only.
Standard WordPress blogs at wordpress.com had 15MB and now 25MB limits (mid-2008), not including any images you use for your templates, those limits are just for you to store your images and files, 300KB for any individual file uploads (mid-2008).
The self hosted version of WordPress that you install is similar to WordPress MU, which is what I have experience with, if you have any doubts as to which of the 3 WordPresses I’m referring to, it’s self-hosted MU by default.
WordPress MU may look similar, but is a different animal altogether on the backend. You have much more control over every aspect of your wordpress blog with WordPress MU.
WordPress MU file size upload limit: from here on I am talking about WordPress MU, but the same applies to WordPress self-hosted.
If you are using MU, then you are storing your website on a host somewhere on the internet. This applies to your hosting account. If you don’t have direct control, it’s ok, just copy and paste these requests and email them to your webhost.
1) First limit is usually 3 Mb by default and is changed in the php.ini file at the host level.
Place this in your php.ini file in your root directory of your WordPress install (usually /public_html)
memory_limit = 32M
upload_max_filesize = 100M
upload_max_filesize = 100M
post_max_size = 100M
note: 100M is entirely too much for most use, this is to enable an upload of the largest file size possible through a web page!
Safer settings:
upload_max_filesize=5M and 20M
post_max_file_size=20M
2) I also had to do this to get the php interpretor to recognize the change and allow large files to be uploaded by adding this to the .htaccess file also in the root directory of my webserver for WordPress:
SetEnv PHPRC /home/yourusername/public_html
A temporary way to increase PHP’s memory is to add this to your PHP script, I prefer to set it above:
ini_set("memory_limit","12M");
You need to add the file type association (windows terminology) as a “Mime Type” (linux server terminology) to the Apache server, or IIS if you’re doing windows hosting (let’s hope you’re not, linux beats windows hosting all day, every day, so far forever)
Find out what Mime Type you need to declare your new file as. ie. myfile.psd is a photoshop file, you probably know this, but your hosting server may not! Look up your file type here, w3schools is a great reference for all website code information, I use them all the time and consider them the authority on the subject of web code and standard ways of doing things.
To do this in WordPress MU use the Admin backend:
"Site Admin"->"Options"->"Upload File Types:" just type in the file extension of the type you want to add with a space separating each extension, no periods here!
I started doing this using pjw-mime-config WordPress Plugin, which will allow you to upload a file with tons of Mime Types already declared for you. WARNING! I found that it added as many listings for each Mime Type to a critical WordPress screen: Site Admin->Blogs->Edit->scroll down and you’ll see a setting for each mime type you’ve added, in my case I had more than 100! Do you want to crash your blog? After disabling PJW Mime types, I still have a super long Blog Edit Screen, it didn’t remove the data, each entry is non-editable for the respective extension (.tif, .psd, etc.) and says SERIALIZED DATA. I decided to use the standard WordPress way of doing it in the future, until I know how to undo this Plugin. Please post a comment if you know how. Update, you can remove mime types to the functions.php file in wp-includes directory at about line (1069).
After doing this you should be able to upload anything up to 100 Mb for individual files and 1Gb for total storage for any user’s blog on the entire domain of your WordPress MU install.
After doing this you will likely run up against the limit of whatever hosting company you have your user account on, which is the account that WordPress is running on. Keep an eye out, it is either limited or you may get charged for extra storage space when your monthly hosting bill is due!
Update:
After making the changes above, I’ve been running some tests and running across a new limit. First my webhost says (and many do say this) there’s a 15Mb limit for PHP HTTP uploads. That’s 15 Megabyte limit for uploading files through a webpage to your server account not using FTP. Now I’ve got up to around 170 Mb through HTTP uploading and am hitting a different limit. First one is file types, large images are no problem, large audio files depend upon the format, even though the file types have been added to the server as Mime types. Same problem with alternate image types like .psd photoshop files, the error at the end of the WordPress upload right after “crunching”, is “File type does not meet security guidelines. Try another.” Renaming the same file to .jpg mitigates that problem, however I haven’t found an easy way to rename the file back to .psd using the HTTP upload interface (the upload webpage)
php ini files are simple and easy once you have your FTP connected. Have fun!
To disable “Make a New Blog” in wordpress MU:
You can modify wp-signup.php file:
Find string 14:
get_header();
and add after it this code:
if ( is_user_logged_in() ) {
$user = $current_user->user_login;
if ($user != 'admin') {
print "You can't create blogs.";
get_footer();
die();
}
} else {
print "You can't create blogs.";
get_footer();
die();
}
Follow directions, I believe you use a supplied custom .htaccess file in the webserver root (public_html)
At hostnine the WordPress MU install was broken (realy just the blogs at virtual subdomains like ratings.googlethem.com because the apache config file (not available to me) had the wildcard subdomains string a line after a different handler.
———-
From wordpress MU forum: http://mu.wordpress.org/forums/topic.php?id=2363&page
Did you ask your hosts (Blue host) to activate wildcard subdomains for you? This is not included in a subdomain limit in any host AFAIK.
It has to be “turned” on in Apache – unless you have access to the server (ie, you’re on a shared system etc…) you are going to have to ask your host to do that part.
——
From: gfmorris.org
Dougal Campbell Says:
December 23rd, 2005 at 2:34 pm
Yeah, on all the servers *I* have dealt with, the web server runs as a different user. The exception would probably be web hosts who run PHP as a CGI process, which allows them to run it through suexec. But when PHP is installed as a module, it executes with the same permissions as the main apache instance, which is typically as the ‘nobody’ user (or a similarly unprivileged account).
You don’t *have* to make the wp-content directory writable for everything. Most parts of WP that need to write files under there are looking at particular subdirectory (cache, uploads, etc). Just make those writable, and there are fewer security concerns.