Menu
Anetico LtdBlog

October Updates 2014

October 28, 2014

I got a new computer last week, I didn’t like windows 8 at first but now I am getting used to it I find it rather good. Swapping all my old files and email accounts over took a while and once that was done I got back to work, updating my websites.

To help keep my web site a little bit safer and help encourage people to stay a little bit longer and have a look around I added a ssl to https://www.livecasinotv.com and one of my other sites. Along the way I also upgraded my templates, it had been several months since I last did any work on them and since then WordPress has got far better. It is my favourite content management system and over the years I have built and improved upon my own set of templates.

The latest addition was a plug in to shrink the page size by removing all the tabs and unnecessary spaces in the html code, this is called minimization. I also made a dynamic php style sheet, all of which lowers the page size and therefore should help speed up loading times.

To use a php file as a css file in wordpress the headers needed to be set, this is fairly easy to find out how to do online but for future reference the main bits of code I needed to integrate it into wordpress are…

<?php
ob_start(‘ob_gzhandler’); /* compresion */
require_once( ‘../../../wp-load.php’ );

$cssColours = get_option(‘my_theme_css’); //#000000 #ffffff #0000ff
$colour = explode(” “, $cssColours);
$body_bg_col = $colour[0];
$font_colour = $colour[1];
$link_colour = $colour[2];

$cssSheet = “body{
margin:0;
background: $body_bg_col;
color: $font_colour; FONT-FAMILY: Arial, Verdana;
FONT-SIZE: 9.8pt;
}”;

$remove = array(“\t”,”\n”,”\r”);
$StyleSheet = str_replace($remove, “”, $cssSheet);
header(‘Cache-control: public’);
header(“Cache-Control: max-age=2592000”); //30days
header(“Content-type: text/css”);
echo $cssSheet;
?>

I have also been using Google’s online page speed tester ( https://developers.google.com/speed/pagespeed/insights/ ) and a few opera browser plug ins to assist me in what needs doing to my websites.


Anetico LtdBlog
Contact