Monthly Archive for January, 2009

K2: Full Height

Imagine. You are using the K2 theme for WordPress and you want your design to be a full height design. Your first thought is probably that you only need to change some bits and pieces in the CSS and your done, right?!

Ok – it’s almost that easy but in the end it took me quite a while to find the proper solution for pages with very little content on it… So to save you the same hassle – here is a how to. I would suggest you add the CSS code to a custom style stylesheet rather than modifying the style.css to keep things easy when upgrading K2.

Step 1: footer.php
Before we start with the required CSS code we need to make a slight adjustment to the footer.php to ensure that the footer div is included in the page div which acts as the wrapper div.

Move this line:

</div> <!-- Close Page -->

Towards the bottom, right before this line:

<?php wp_footer(); ?>

Step 2: make html and body both 100% in height

html, body {
 height: 100%;
 }

Step 3: adjustments to #page

#page {
 padding-top: 0;
 border-bottom: none;
 height: auto !important;
 height: 100%;
 min-height: 100%;
 }

Step 4: adjustments to #header

#header {
 border-top:  20px solid #fff;
 }

Step 5: adjustments to .content

.content {
 padding: 0 20px 62px;
 }

Step 6: adjustments to #footer

#footer {
 padding: 10px 0 10px;
 position: absolute;
 bottom: 0;
 width: 100%;
 }

Final action

Ok, that’s basically it although you now need to check if some values need to be changed or not. I have changed the padding of the footer (see step 6) to 10px for both the top and the bottom. With these padding values I need a padding value of 62px for the bottom in the content div (see step 5).

Tip: to see how much you need for the bottom padding in step 5 is to add a background color to the footer and then make a screenshot. In, for example, Photoshop you can then easily get the height of the footer. Just a few more pixels to that as a spacing between the content and the footer and you are all set.

Tested with K2 r743 with FF3, IE6, and IE7.

Dutch translation for DB Cache plugin

I came across a nice caching plugin for WordPress that works a bit different than the other available caching plugins, it’s called DB Cache.

For whoever needs a Dutch translation file for it – here it is. Just copy the code below to a newly created file called nl_NL.php in the /wp-content/plugins/db-cache/languages/ directory and you are ready to go.

<?php

$dbc_labels['configuration'] = "Configuratie";

$dbc_labels['activate'] = "Activeren";

$dbc_labels['timeout'] = "Laat een cached query verlopen na";
$dbc_labels['timeout_desc'] = "minuten. (Verlopen bestanden worden automatisch verwijderd.)";

$dbc_labels['tablesfilter'] = "Tabellen om te cachen";

$dbc_labels['saved'] = "Instellingen opgeslagen.";
$dbc_labels['cantsave'] = "De instellingen konden niet worden opgeslagen. &lt;a href=\"http://codex.wordpress.org/Changing_File_Permissions\" target=\"blank\"&gt;CHMOD 755&lt;/a&gt; bestand: &lt;u&gt;config.ini&lt;/u&gt;";
$dbc_labels['activated'] = "Caching geactiveerd.";
$dbc_labels['notactivated'] = "Caching kan niet worden geactiveerd. &lt;a href=\"http://codex.wordpress.org/Changing_File_Permissions\" target=\"blank\"&gt;CHMOD 755&lt;/a&gt; de folder: &lt;u&gt;wp-content&lt;/u&gt;";
$dbc_labels['deactivated'] = "Caching uitgeschakeld. Cache bestanden verwijderd.";
$dbc_labels['cleaned'] = "Cache bestanden verwijderd.";
$dbc_labels['expiredcleaned'] = "Verlopen cache bestanden verwijderd.";

$dbc_labels['save'] = "Opslaan";
$dbc_labels['clear'] = "Leeg de cache";
$dbc_labels['clearold'] = "Leeg de verlopen cache";

?>

1x A Wonderful New Year

A Wonderful New Year