I started working on a project site that is going to use WordPress as the CMS engine. I wasn’t sure if this was going to work, but after a little time I found this was pretty easy to do. You start by deleting all the default content and disabling the default plug-ins and management screen options. Once everything is removed/disabled, you start by creating pages (e.g. Home, About, News, etc…) that will display all the content you need on the website. One you have your main page setup (e.g. Home), you need to change the default home page from a dynamic page of blog posts to a static page. You change the default home page under Settings –> Reading –> Front Page Display –> A Static Page –> Choose an option from the Front Page drop down list. That’s it, you now have WordPress running as a basic CMS soltuion.
I wish I could say that’s it, but most likely you’ll need to download and install some additional plug-ins. I found many plug-ins still do not support WordPress 3.0, so you’ll need to be careful! If you happen to install a bad plug-in, there is an easy fix to get you site back online… Delete the plug-in folder (via FTP or Hosting Control Panel) and WordPress will automatically disable the plug-in.
Here is the list of plug-ins I added for my project:
- Contact Form 7
This is a great plug-in, it provides a easy way to create forms that get emailed to you. You create the forms using HTML online and a shortcode style syntax for the input fields. The shortcode inputs are then accessible in your email, that you also create using HTML. - WP Google Maps
This is a very basic Google Maps plug-in, the is about 10 options and the only think extra you need is a GoogleMaps API key. - WordPress.com Stats
I’ve been using this on my blog and love the UI. I wish this was all being done client-side, but for some reason it was created as service. By default it injects a smiley face into your page, so make sure you disable this in your themes style sheet.
The only other thing I added was a SSL plug-in that I created based on 3 other plug-ins. I created my own, so I could force WP to load specific pages as HTTPS and then default back to HTTP if it was not explicitly set to support SSL. I found most of the default plug-ins will leave the user browsing in SSL after they visit a SSL page, I didn’t want this and my plug-ins solves this problem.
<?php
/*
Plugin Name: WPSSL Force SSL
Plugin URI:
Description: This plug-in is based on WPSSL, forcessl and various other posts/comments I found while searching for a soltuion. The plug-in is used by adding the meta tag "force_ssl" with any value to any pages where you want SSL ("HTTPS") enabled. If the page does NOT have this set and your not looking at an admin page (you can enable SSL for admin/login page in wpconfig.php), then display as HTTP. This prevent links on the SSL page from displaying as SSL for non-secure pages. This plug-in was tested on WordPress 3.0.
Author: Zachary Hunter (based on Austin Web Development)
Version: 1.0
Author URI:
*/
function wpssl_forcessl()
{
global $post;
$post_id = $post;
if (is_object($post_id))
{
$post_id = $post_id->ID;
}
$force_ssl = get_post_meta($post_id, 'force_ssl');
if(!empty($force_ssl))
{
if(!stristr($_SERVER['REQUEST_URI'], 'wp-admin')) {
if($_SERVER["HTTPS"] != "on") {
$newurl = "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
header("Location: $newurl");
exit();
}
}
} else {
if(!stristr($_SERVER['REQUEST_URI'], 'wp-admin')) {
if($_SERVER["HTTPS"] == "on") {
$newurl = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
header("Location: $newurl");
exit();
}
} }
}
add_action('wp', 'wpssl_forcessl');
?>
To use the plug-in follow these steps.
1. Copy the code above into a file in your plugin folder (e.g. /wp-content/plugins/wpssl/wpssl.php).
2. Go to the Plugins -> Plugins and enable “WPSSL Force SSL”.
2. Go to the Page you want to force SSL and open the “Custom Fields” section.
3. Click “Add Custom Field”, and use the settings below (name = force_ssl, value = true).
** DONE **
#1 by Alfredo M. Gapuz Jr. DMD on June 3, 2011 - 7:53 am
Very interesting article. I’ve been trying to figure things out for my blog and this has helped me quite a bit.
#2 by desertrat on February 7, 2011 - 8:37 am
Thank you!! This resolved a problem I was having with the WPSSL plugin. The plugin would change any link to other websites on an SSL page from http to https, thus disabling any link to a third party website!
This code resolved the problem. Thank you!
#3 by Rhianon on January 21, 2011 - 9:36 am
When I downloaded this plugin from within wordpress, it wasn’t working (the pages would stay https). So I copied what you have above, and it now works.
whew! If you put out any updates, I hope you don’t break my clients site! lol.
#4 by Jamie C on January 15, 2011 - 5:37 am
Zach, this is amazing! Thanks so much for the SSL plugin.
The only problem I’m having is that WordPress is still requesting non-secure files from the plugin directory – do you know how to overcome this so I don’t get horrible SSL error messages?
Thanks!
#5 by Alan Snowden on January 6, 2011 - 7:19 pm
Hi i’ve installed your plugin on the omveda.com website and followed instructions correctly ( as far as I can tell ) yet there is no new meta tag appearing on the page I have added the custom field to https://omveda.com/shop …. and of course IE is still showing it’s warning message!
Any help would be gratefully accepted 😉
#6 by Chad on October 18, 2010 - 8:04 am
Heya, i have been searching for an SSL plugin and this one looks perfect, im just not sure how to install it….
#7 by Zach on October 20, 2010 - 11:38 pm
Chad, I’ve updated the article with instructions how to enable. Here the info you need…
1. Copy the code above into a file in your plugin folder (e.g. /wp-content/plugins/wpssl/wpssl.php).
2. Go to the Plugins -> Plugins and enable “WPSSL Force SSL”.
2. Go to the Page you want to force SSL and open the “Custom Fields” section.
3. Click “Add Custom Field”, and use the settings below (name = fores_ssl, value = true).
** DONE **
This is based on the update to the PHP, which gave the plugin the name of “WPSSL Force SSL”.
#8 by Andrew on September 22, 2010 - 11:35 am
haha, nevermind, I fixed it. great job! thank you
#9 by Zach on October 6, 2010 - 8:10 am
Andrew, sorry for the late reply I’ve been traveling… What was the error? I’ve had a few other people say they had problems making the SSL plug-in work but I’ve used it 3 times without any problems. I’d be interested in knowing what type of error you had. Thanks!
#10 by Andrew on September 22, 2010 - 10:22 am
sorry, the page is:
http://www.runningwall.com/hawkeye-50k-25k-registration
#11 by Andrew on September 22, 2010 - 10:20 am
I have this site setup for force_ssl http://www.runningwall.com/hawkeye-50k-25k, but when I click on a link it stays in https.
Ideas?
#12 by Deborah on August 24, 2010 - 9:46 am
This may work however. I just tested my https on a non-wordpress page and it doesn’t work yet. Wait until I get that resolved and retest the installation.
#13 by Deborah on August 24, 2010 - 9:38 am
I have tried your plugin on 3.0.1 and get no response. It does not break the site however which is a big plus in my book. I have also done the custom field and meta-data to true. Have you tried this on 3.0.1 yet? Is there something I’m missing?
#14 by Zach on August 23, 2010 - 1:45 pm
Cezar,
I just double checked and everything and the code above is working perfectly on my project site with the code above. I have 1/10 pages with SSL enabled and all the links on the HTTPS page have their URLs rewritten. When I click on one of the links to a non HTTPS page (e.g. Membership to Home), the code redirects me from HTTPS to HTTP without any errors/messages. I have the code working live, I’ll add it onto a clean dev box tonight and let you know if I have a similar error. Are you using WordPress 3.x+ ?
#15 by cezar on August 23, 2010 - 4:21 am
did that now it goes into a looping redirect.
“The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”
#16 by Zach on August 3, 2010 - 10:18 am
Cezar,
The only additional thing you need to do is set “force_ssl” in the meta-data to true.
Zach
#17 by cezar on August 3, 2010 - 9:09 am
Hi Zach,
I tried your plugin. it seems to do the redirect part but for me the link then goes into a 404 error.
Do i need to change anything else?
C