There is no need to buy a landingpage theme. You can easily build one for free with the new default WordPress theme 2012 (Twenty Twelve)!

First install WordPress

Of course first you need to install WP on your webserver or webspace. If you have a decent hoster this can easily be done by one click through your user-interface. If that is not the case you’ll find lots of howtos on the web how to install WordPress. Don’t be afraid it is really easy!

After you made sure that your WordPress is successfully installed log in to the backend. Switch to the menu point Appearance.

Second remove clutter

With the landing page you basically want a user to do a specific action. That could be anything from a newsletter sign-up, filling out a contact form, call a phone number, register for a service to to doing a sale. To get to that point there has to be only one (main) action the user can actually do on the website. You have to lead the user to the action and there should be no distractions that move your user away from fulfilling the actions. For building our landing page with the WordPress theme Twenty Twelve this means that you want to get rid of navigations (main, sidebar, footer), additional blocks (widgets) and misleading site elements.

Helpful page templates

Most of the stuff is actually removed with just one setting! The new theme brings by default two templates which are suitable for a landing page design. One is called Front Page Template and the other is called Full-Width Page Template, No sidebar. You can choose either one, they will both work.

Remove main menu

Ok, I have to admit on this part I do a trick. Instead of really removing the menu we use an empty custom menu. To do that you first have to create a custom menu. In Appearance you’ll find the menu entry “Menus” which gives you all the options you need! Just create a new menu with a random name. Do not add any menu points to that menu. Choose the menu in Theme Locations as Primary menu. That’s it! You just made the menu disappear.

Change footer link in Twenty Twelve theme

In my lovely country (I live in Germany) there are some legal obligations to show an imprint on every commercial website which has to be reachable from every page on the website. There already is a link which fits this description and is a bit annoying for our purpose anyway: the WordPress default footer link. Luckily WordPress is very customizable and we can take over this hyperlink. Here is how you change the footer link in the Twenty Twelve theme. Other themes are very similar. You just have to look for other strings.

In Appearance you will find the on-board Editor. If your webserver settings are correct you can easily edit some of the WordPress sourcecode directly online. Look for the following string:


<div class="site-info">
<?php do_action( 'twentytwelve_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->

It is HTML markup and some PHP code. Strip it to:


<div class="site-info">
<a href="" title=""></a>
</div><!-- .site-info -->

And paste your link (URL) in between the apprentices after the href-tag and also set a title for the link by writing something in between <a href=...> and </a>.

Now you should have a result similar to the following picture.

Free landing page with Twenty Twelve WordPress Theme 300x115 Build a free landing page with the Twenty Twelve WordPress theme

A few more steps with Twenty Eleven and Twenty Ten

So start building your landingpage by removing everything. This is how you do it with WordPress:

  • In Appearance again switch to Widgets.
  • Check all widget areas for widgets and remove them

Now you can concentrate on building the content for the page!

I hope you liked my howto. If you have any questions or suggestions please leave a comment. Share this tutorial with people that might find it helpful as well and don’t forget to subscribe to our feed for future tips and tricks.

2 Kom.

For a new hosting service I am using the new WordPress 3.x multi-site features extensively. For new customers I added a custom theme based on the default Twenty Ten theme. As the main audience aren’t native speakers – English that is – I also need translations for my custom theme. I followed the path twentyten is showing my copying my .mo file into a subdirectory of the theme called languages. Unfortunately the file is not loaded automagically so you need some custom code which I added to my custom theme’s functions.php file.

1
2
3
4
5
6
7
const MY_THEME = 'name of your theme';
function mytheme_setup() {
        // The first occurence of MY_THEME is the name of your textdomain as used in the templates
	load_theme_textdomain( MY_THEME, str_replace('twentyten', MY_THEME, TEMPLATEPATH) . '/languages' );
}
// Tell WordPress to run mytheme_setup() when the 'after_setup_theme' hook is run.
add_action( 'after_setup_theme', 'mytheme_setup' );

If you are defining your own version of twentyten_setup() just add the line with load_theme_textdomain(…) in there. OOP in WordPress would be nice here and make things so much easier!

keine

Setting up your own website to display a collection of videos hosted on YouTube is as easy as following the six simple steps below.

  1. Download and install WordPress 3.0
  2. Download, install and activate the Videographer WordPress Theme
  3. Download, install and activate the WP YouTube plugin by Jens Törnell
  4. Download, install and activate the WP-PostRatings plugin by Lester ‘GaMerZ’ Chan
  5. Follow the rest of the instructions in paragraph Setting up Videographer on the Videographer site.
  6. You are ready to go to publish your first video!

Have a look what a site for viral videos will be like once filled with lots of content.

keine

keine

The Seagull framework which we love to use for our projects offers two built-in methods for session management: files and database.

In our podcast project we started out using the file based sessions years ago. A while back we switched to so-called extended sessions which are saved in the database. Not so long ago we switched back to files again as the requests just for the sessions to the database became a serious bottleneck in our installation.

We did a relaunch of our podcast service beginning of September with sessions still stored to in files. This might have worked well if we had not switched to serving the website’s resources including the sessions through a high available NFS4 server. The server with the active NFS4 export hit its maximum capacity randomly making the service unusable.

I could have tried to switch back to the database handler as we have new, much more powerful machines. But I did not even bother as I assumed I’d eventually run into the same problems as before. Instead I researched sessions saved in memory. I knew that PHP offers shared-memory sessions. I tried that a while ago with no luck. During my research I came across memcached sessions. As I am already using memcache to store objects in the application I thought this would be ideal. And as it turned out today when applying the following changes to our live system it is!

To make Seagull work with memcached sessions only two minor changes to the code base had to be made. In the SGL core library Session.php change the constructor as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
        if ($conf['session']['handler'] == 'database') {
             $ok = session_set_save_handler(
                array(& $this, 'dbOpen'),
                array(& $this, 'dbClose'),
                array(& $this, 'dbRead'),
                array(& $this, 'dbWrite'),
                array(& $this, 'dbDestroy'),
                array(& $this, 'dbGc')
                );
        } elseif ($conf['session']['handler'] == 'memcache') {
           session_save_path($conf['session']['save_path']);
        } else {
            session_save_path(SGL_TMP_DIR);
        }

The second change is in the _init function:

1
2
3
4
5
6
7
8
9
10
11
12
13
            if ($conf['session']['handler'] == 'file') {
                //  manually remove old session file, see http://ilia.ws/archives/47-session_regenerate_id-Improvement.html
                $ok = @unlink(SGL_TMP_DIR . '/sess_'.$oldSessionId);
            } elseif ($conf['session']['handler'] == 'database') {
                $value = $this->dbRead($oldSessionId);
                $this->dbDestroy($oldSessionId);
                $this->dbRead(session_id());          // creates new session record
                $this->dbWrite(session_id(), $value); // store old session value in new session record
            } elseif ($conf['session']['handler'] == 'memcache') {
                // do nothing - just do not complain or fail
            } else {
                die('Internal Error: unknown session handler');
            }

So just add the lines with memcache and below. That’s it!

To make Seagull use the memcache session handler adjust your config accordingly, e.g. my local one looks like the following:

1
2
$conf['session']['handler'] = 'memcache';
$conf['session']['save_path'] = 'tcp://127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15';

Live we use several memcache servers which you can address with a comma separated list of servers, e.g.

1
2
$conf['session']['handler'] = 'memcache';
$conf['session']['save_path'] = 'tcp://127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://127.0.0.1:11212?persistent=1&weight=2&timeout=1&retry_interval=50';

Make sure your memcache server(s) listen(s) on the correct IP address and port. Otherwise you will get a blank screen and/or a nasty error message.

Now you should be ready to go. Experience a never before known speed of your PHP applcation!

einer

Heute ist WordPress in der Version 2.8 erschienen. Da ich momentan an einem WordPress-Plugin arbeite, interessant mich nicht nur, was sich an der Oberfläche oder am Funktionsumfang geändert hat, sondern auch was es für Neuerungen im Inneren gibt.

Ein diff zwischen WordPress 2.7.1 und WordPress 2.8 gibt mir 1194 Zeilen zurück. Ein Blick auf die Änderungen zeigt mir, dass der Code aufgeräumt. Es kommen jetzt z.B. die neuen Funktionen der esc_-Serie zum Einsatz.

Eine der spannendsten Neuerungen dürfte die neue Widgets API sein. Um ein mehrfach instanzierbares Widget zu erstellen, wird die Klasse WP_Widget erweitert. Die drei Methoden widget(), form() und update() müssen in der eigenen Klasse überschrieben werden.

Die Menüs lassen sich jetzt mittels Plugin aufbauen/umordnen. Einige Fantasie vorausgesetzt, öffnet das ungeahnte neue Möglichkeiten. Das Menü war bisher sehr starr und hat damit das Layout aller Themes stark bestimmt. Mit einem programmatisch änderbaren Menü werden wir interessante, neue Layouts sehen.

keine

Today I did a long overdue update of a textpattern installation. Nothing easier than that!

# wget http://textpattern.com/file_download/37/textpattern-4.0.5.tar.gz

# tar xzvf textpattern-4.0.5.tar.gz

# rsync -avz textpattern-4.0.5/ html/

Log in as admin, refresh the installed language pack(s), done!

keine

Being inspired by a long talk yesterday at Berlin2.0 I decided to dig into Google´s offerings on the AdWords API today. Getting an API code is terrifying difficult. First you have to create a My Customer Center account if you do not have own one, yet. Create your AdWords API account and have a credit card ready. You need it to get the developer and application tokens.

I´d hope to find a toolkit from my favorite package source PEAR or for the Zend Framework but since there is an offering from code.google.com nobody bothered to develop anything. I downloaded the Google APIlity PHP Library for AdWords and the APIlity MySQL Schema to modify it for my own purposes.

keine