• Skip to primary navigation
  • Skip to main content
  • Home
  • Archives

divydovy

Just another human

  • Weekly photos – 2021
  • Contact Me

Archives

The Raw Deli

July 12, 2011 by David Lockie

The Raw Deli

This site was built for my brother’s girlfriend’s living foods business, to her own design and specification. I consulted with her to make sure the site would fulfil her business requirements then built it as a custom child theme of Thematic using WordPress, so she can easily update all aspects of the site and take bookings for her events.

Filed Under: portfolio Tagged With: child theme, crossslider, CSS, gravity forms, jquery, thematic, wordpress

My Meeting Professional

July 11, 2011 by David Lockie

My Meeting Professional

This site was built in conjunction with Liberate Media, a jolly nice and talented local agency. Upon request, I provisioned and project managed the creative graphic design element of the site, working with the talented Atelier Grafik, then built the site using WordPress by creating a custom child theme of Thematic.

Filed Under: portfolio Tagged With: child theme, CSS, disqus, gravity forms, jquery, PHP, thematic, wordpress, XHTML

Madano

June 27, 2011 by David Lockie

Madano Partnership

Designed and planned by the lovely folks at the Madano Partnership, this site uses WordPress and a custom child theme of Thematic to provide a number of different custom post types, carousels and neat functionality to convey effectively their commercial offering.

Filed Under: portfolio Tagged With: child theme, CSS, cufon, custom post type, gravity forms, jcarousel, jquery, madano, PHP, thematic, wordpress, XHTML

Configuring WPML to work with Thematic WordPress theme

June 27, 2011 by David Lockie

Hope this’ll save someone the same painful process of Google searching leading to broken page links and out of date instructions/screenshots.

So, you’ve got WordPress installed, Thematic as your theme or parent theme and you’ve installed WPML (I’m using v2.3.2), selected your languages and options and are now in ‘Theme and Plugins Localisation’ in the WPML menu in the CMS.

Follow these steps:

  1. Choose ‘Translate by .mo files’, but don’t select the ‘automatically load’ checkbox underneath.
  2. Save
  3. You’ll see a table below with a list of translation files that the plugin is looking for with ‘File not found’ everywhere.
  4. Go to ‘Theme Localisation‘ on the WPML site
  5. Download the language .mo files you want and save them to /wp-includes/languages
  6. Now that’s the WordPress languages done – hopefully if you now refresh the CMS page we’re on, you’ll see ‘File exists’. Ah, that feels good.
  7. Now for the Thematic language files.
  8. Go into thematic/library/languages and copy the .mo files you want to the root thematic folder
  9. Again, refresh the WPML settings page and BOOM! you should now see that all files exist.
  10. Wipe sweat from furrowed brow

I’m using WPML for a custom Thematic child theme, so I’ll post back any further findings of interest.

Filed Under: web Tagged With: compatability package, localisation, MO, thematic, theme, wordpress, wordpress multilanguage, wpml

WordPress Function to Redirect All Incoming Domain Requests to the Primary Domain Variant

June 17, 2011 by David Lockie

This is something that has bugged me for ages. Surely there’s a way to redirect domain.com, *.domain.com, www.domain-variant.com, etc to the primary WordPress domain, www.domain.com using a WordPress function? Something that I can simply copy and paste for all my theme development without having to worry about the eventual web hosting environment or domain host.

We’re assuming here that we need to do this within WordPress because:

  • The domain host doesn’t provide enough web forwarding control
  • We’re on shared hosting where we can’t do an .htaccess redirect
  • We want to do it within WordPress for any other reason

I’m also assuming that all the domains and variants are already pointing at the correct server/virtual host.

I put a shout out to the http://www.wp-brighton.org.uk/ WordUp! mailing list to see what approaches people take. My favourite answer was from Tom Barrett, who suggested:

add_action('setup_theme', 'check_my_host');
function check_my_host(){
// Check host in _SERVER
// Find site_url
// Check protocol http/https
// String together pieces to compare with host
// Parse PATH_INFO (to deal with installs in sub directories)
// Use wp_redirect() and exit.
}

Now, I’m not as clever as Tom, so my code isn’t as thorough as his, but as I don’t tend to do sites that use SSL anyway, I decided to keep things simple and ignore that!

Here’s my variant, totally inspired by Tom:

// Redirect all site requests to this virtual host to the siteurl address
function check_my_host() {
// Check host in $_SERVER
$incomingHost = 'http://' . $_SERVER['HTTP_HOST'];
$incomingQuery = $_SERVER['REQUEST_URI'];
// Find site_url
$primaryHost = get_bloginfo ( 'siteurl' );
$redirectTarget = $primaryHost . $incomingQuery;
// Compare incoming and primary hosts
if ( strtolower( $incomingHost !== $primaryHost ) ) {
// If they're not equal, use wp_redirect() and exit
wp_redirect( $redirectTarget, 301 ); exit;
}
}
add_action('template_redirect', 'check_my_host');

I’ve tested it and it seems to work solidly for redirecting both domain root and domain + query requests.

I’ve got no doubt this can be improved (to account for http/https protocols and various other clever checks) so please do leave comments and I’ll update this function (with credits where appropriate).

Filed Under: web Tagged With: 301, canonical, domain, PHP, redirect, subdomain, wordpress

Da Costa Coaching

June 7, 2011 by David Lockie

Da Costa Coaching

A simple but elegant site, designed by Atelier Grafik and realised as a custom WordPress theme.

Filed Under: portfolio, portfolio-featured Tagged With: child theme, CSS, gravity forms, joshua vanderbroek, mailchimp, thematic, wordpress

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Go to page 6
  • Go to page 7
  • Interim pages omitted …
  • Go to page 22
  • Go to Next Page »

Copyright © 2021 · Revolution Pro on Genesis Framework · WordPress · Log in