Ive updated the links in header.php so now you can keep the default. I was looking at bootstrap which is a frame work for @media css. Instead of using bootstrap i wanted to have a go at the css. It should be possible for any theme i only edited 3 files (so far) header.php, footer.php & theme css
heres the css i might not use them all but going forward it might become useful, if you look at the first two you see its show or hide with display none. You also notice the different screen size. Now we have media querys we can play with the php files (html in php)
@media only screen and (min-width: 430px) {
.myBlock-show {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
.myBlock-hide {
display: none;
vertical-align: top;
width: 170px;
}
}
@media only screen and (min-width: 430px) {
td.myBlock-show {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
td.myBlock-hide {
display: none;
vertical-align: top;
width: 170px;
}
}
@media only screen and (min-width: 430px) {
.myBlock-show.td {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
.myBlock-hide.td {
display: none;
vertical-align: top;
width: 170px;
}
}
@media only screen and (min-width: 430px) {
.myBlock-show {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
.myBlock-hide {
display: none;
vertical-align: top;
width: 170px;
}
}
@media only screen and (min-width: 430px) {
td myBlock-show {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
td myBlock-hide {
display: none;
vertical-align: top;
width: 170px;
}
}
@media only screen and (min-width: 430px) {
.myBlock-show td {
display: none;
width: 50%;
vertical-align: top;
}
}
@media only screen and (max-width: 430px) {
.myBlock-hide td {
display: none;
vertical-align: top;
width: 170px;
}
Now for the header i only add a new class to the table <td class="myBlock-hide" valign="top" > this tells the side blocks to hide if screen is below a certain size
<table cellspacing="0" cellpadding="7" width="100%" border="0">
<tr>
<?php if ($site_config["LEFTNAV"]){?>
<!-- START LEFT COLUM -->
<td class="myBlock-hide" valign="top" >
<?php leftblocks();?>
</td>
<!-- END LEFT COLUM -->
<?php } //LEFTNAV ON/OFF END?>
<!-- START MAIN COLUM -->
<td width="100%" valign="top">
You also need to add a metatag at the top
<meta name="viewport" content="width=device-width">
Lastly the footer we need to tell the right side blocks to hide as well
<?php function_exists('T_') or die;
if ($site_config["MIDDLENAV"]){
middleblocks();
} //MIDDLENAV ON/OFF END
?>
</td>
<!-- END MAIN COLUM -->
<?php if ($site_config["RIGHTNAV"]){ ?>
<!-- START RIGHT COLUMN -->
<td class="myBlock-hide" valign="top" >
<?php rightblocks(); ?>
</td>
<!-- END RIGHT COLUMN -->
<?php } ?>
</tr>
</table>
</div>
I then put in footer the response code which is basically the header and footer code combined without the middle blocks but this is myBlock-show so on mobiles this code will show if you look at the css you will see its set to 50%
<!-- Start response -->
<div id='main'>
<table cellspacing="0" cellpadding="7" width="100%" border="0">
<tr>
<?php if ($site_config["LEFTNAV"]){?>
<td class="myBlock-show" valign="top" >
<?php leftblocks();?>
</td>
<?php } ?>
<?php if ($site_config["RIGHTNAV"]){ ?>
<td class="myBlock-show" valign="top">
<?php rightblocks(); ?>
</td>
<?php } ?>
</tr>
</table>
</div>
<!-- End response -->
The only issue i had was most of the style is in pixels (wrapper, header etc) it should be in % so it adjusts also you may need css to 2 off the blocks 1 on either side just so the size of both are the same.
Now the layout is responsive we can get creative and edit other stuff by adding the class like
<div class="myBlock-hide">
<td class="myBlock-hide">
Anything wrapped will either show or hide
You can also just add a new line on your css file like
body {
background-color: lightblue;
}
@media screen and (min-width: 400px) {
body {
background-color: lightgreen;
}
}