WordPress – CB-Net Tech snippets and my personal knowledgebase! Sun, 07 Jan 2018 10:46:42 +0000 en-GB hourly 1 https://wordpress.org/?v=6.7.1 /wp-content/uploads/2018/01/cropped-Adobe-Spark-8-32x32.png WordPress – CB-Net 32 32 Increasing page width in the WordPress Theme Twenty Seventeen /site-news/wordpress/increasing-page-width-wordpress-theme-twenty-seventeen/ /site-news/wordpress/increasing-page-width-wordpress-theme-twenty-seventeen/#respond Sun, 07 Jan 2018 10:46:42 +0000 /?p=1327 As-per : https://www.vanilla-wp.org/twenty-seventeen-theme-full-width-wordpress/

You can increase the displayed page width in the Twenty Seventeen theme using the following “Additional CSS” (can be found under Customise > Additional CSS).

To modify the percentage of the screen that can be used change this percentage **only** – the other percentages affect padding/ borders etc and will affect how appears on smaller displays.

@media screen and (min-width: 48em) {
 .wrap {
 max-width: 70%;
 /* padding-left: 3em; */
 /* padding-right: 3em; */
 }
}

Full Additional  CSS to add to your site set to 70% width:

.wrap {
 /* margin-left: auto; */
 /* margin-right: auto; */
 max-width: 100%;
 /* padding-left: 2em; */
 /* padding-right: 2em; */
}
 
@media screen and (min-width: 48em) {
 .wrap {
 max-width: 70%;
 /* padding-left: 3em; */
 /* padding-right: 3em; */
 }
}
 
.page.page-one-column:not(.twentyseventeen-front-page) #primary {
 /*margin-left: auto;*/
 /*margin-right: auto;*/
 max-width: 100%;
}

@media screen and (min-width: 30em) {
 .page-one-column .panel-content .wrap
 {
 max-width: 100%;
 }
}
]]>
/site-news/wordpress/increasing-page-width-wordpress-theme-twenty-seventeen/feed/ 0
Enabling WordPress SSL using Cloudflare Flexible SSL /site-news/wordpress/enabling-wordpress-ssl-using-cloudflare-flexible-ssl/ /site-news/wordpress/enabling-wordpress-ssl-using-cloudflare-flexible-ssl/#respond Fri, 31 Mar 2017 17:35:44 +0000 /?p=1155 Enabling SSL within WordPress is not a simple task if you rely upon the “flexible SSL” offering from CloudFlare. You will end up with SSL infinite redirects and will likely be unable to get into your admin interface without editing config files.

Getting this to work though, with the help of a plugin, can be relatively straight-forwards.

First, you need to install the following plugin on your WordPress installation: https://wordpress.org/plugins/cloudflare-flexible-ssl/

Next, within the CloudFlare configuration for your domain, browse to “Page Rules” – you want to create a new Page Rule:

Enter http://www.<your domain>.<name>/* – for example http://www.cb-net.co.uk/* and then, from the drop down box, select “Always use HTTPS” – finally, click “Save and Deploy:”

That’s it.. browse to your site’s URL and confirm the traffic is automatically redirected to HTTPS.

You do not have to change the WordPress config – to re-enable HTTP access remove the CloudFlare rule.

]]>
/site-news/wordpress/enabling-wordpress-ssl-using-cloudflare-flexible-ssl/feed/ 0
Site Migration from Joomla to WordPress /site-news/site-migration-from-joomla-to-wordpress/ /site-news/site-migration-from-joomla-to-wordpress/#comments Mon, 19 Sep 2016 16:40:58 +0000 http://wp.cb-net.co.uk/?p=3 So, I’ve just competed a move of CB-Net from Joomla to WordPress – the process was surprisingly easy, although there were a couple of gotchas I thought I would share, as well as the process from start to finish.

Migration Pre-Requisites

I won’t cover how to deploy WordPress in this article, this is well documented here. This post assumes you have a fresh, working, WordPress install and a pre-populated Joomla site.

In my case, I had deployed WordPress, temporarily, to wp.cb-net.co.uk, whilst my production Joomla site was running at www.cb-net.co.uk. Both Joomla and WordPress sites have to be running at the same time to facilitate the migration outlined below.

Other information you will need to complete the migration – available from your Joomla configuration.php file if you are unsure.

> Joomla site URL
> Joomla site MySQL database server name
> Databse poryt
> Database name
> Username
> Password

I’ll stress the need for backups at this stage. Backup your Joomla site, and backup your WordPress site, hell backup everything. And be sure you know how to restore those backups, you may need them. If you lose your data its your responsibility, not mine!

WordPress Configuration

This is pretty straightforwards, assuming you have a fresh WordPress instance up and running you’ll just need to install and activate the FG Joomla to WordPress plugin, found here.

The Migration / Import Itself

Under Plugins | Installed Plugins, under “FG Joomla to WordPress”  click “Import” to start the migration wizard.

You’ll need to enter / confirm the following information to be able to start the process.

Joomla web site parameters
> URL of the live Joomla web site


Joomla database parameters
> Hostname
> Port
> Database
> Username
> Password
> Joomla Table Prefix

Once entered, hit “Start / resume the import” and review the output form the log which appears in real-time. Hopefully you’ll have no issues, however if you do I suggest you head-over to the support forum for this plugin here.

At this stage, do not modify internal links – unless you are already running your WordPress instance on the desired URL.

Keeping the URL The Same

Ultimately, I wanted to ensure that the site was running on www.cb-net.co.uk, not wp.cb-net.co.uk.

From the WordPress Dashboard go to Settings| General, you need to change the URL under “WordPress Address (URL)” and “Site Address (URL).” Note, when you do this you will lose access to your site, that ism until you move the files/content to the folder associated with the new/desired URL.

Now, from your hosting providers console / GUI or shell (your choice, and the process itself will vary wildly) you need to move the files associated with your Joomla site (remember, you have a backup right?) to a temporary folder and then, move the files associated with the WordPress install into the folder that Joomla once resided. For me this meant:

1. Moving files from /cb-net.co.uk-root/ to /tmp/ (moving Joomla out)
2. Moving files from /wp-cb-net.co.uk/ to /cb-net.co.uk-root/ (moving WordPress in)

Once completed, you should be able to browse to the WordPress site, on the desired URL; for my WordPress instance that was originally deployed to wp.cb-net.co.uk was now available at www.cb-net.co.uk, where Joomla once resided.

Finally, for this section, go back to Plugins | Installed Plugins, under “FG Joomla to WordPress” click “Import” to finish-off the migration wizard. Scroll to the bottom and click the “modify internal links” button.

URL Redirection (maintaining legacy URLs)

My previous site had been “live” for 8 years, I had saved links, and I know others did too – it was important that I was able to still service those legacy URLs, without that need getting in the way of the platform move to WordPress. The URLs before and after the migration were very different:

Before: /citrix-articles/16-presentation-server/25-troubleshooting-citrix-session-poor-response-high-latency$ 

After: /citrix-articles/server/troubleshooting-citrix-session-poor-response-high-latency

Come to the rescue the .htaccess file and, specifically, mod_rewrite.

I got a copy of the sitemap (using a plugin) for my Joomla site, took all of the URLs and created a before and after in Excel. I then simply copied these URLs into an online tool, found here, to create the htaccess rewrite rules.

Note that under Settings | Permalinks I had configured a “custom structure” for links to be:

/%category%/%postname%/

An example rule can be seen below – note that I had to put these rules at the top of the .htacces file, otherwise these rules did not work.

With this done, you’re done – content migrated and old links work.

# BEGIN CB-Net Redirects folling WordPress Migration
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^citrix-articles/16-presentation-server/25-troubleshooting-citrix-session-poor-response-high-latency$ /citrix-articles/server/troubleshooting-citrix-session-poor-response-high-latency/? [L,R=301]
</IfModule>
]]>
/site-news/site-migration-from-joomla-to-wordpress/feed/ 2