As promised, here is a quick tutorial on how to integrate the flickr gallery plugin with the Blix theme. Since my hosting provider, DreamHost, has disabled libcurl calls I used Nick Bouton’s version of the plugin.

Step 1:
I created a generic gallery page in my main wordpress directory named gallery.php
gallery.php source:

<?php
$_SERVER['PATH_INFO'] = '';
require('./wp-blog-header.php');
include(TEMPLATEPATH . "/gallery.php");
?>

Step 2:
Next I created a custom page template for Blix, again named gallery.php
wp-content/themes/Blix/gallery.php source:

<?php
/*
Template Name: gallery
$page='gallery'
*/
?>

<?php get_header($page); ?>

<!-- content ................................. -->
<div id="content">

<?php flickr_show_photos($_GET['album'], $_GET['photo']); ?>

</div> <!-- /content -->

<?php get_footer(); ?>

Step 3:
I modified the header.php for Blix so that the gallery page would show up as a themed page.
Here is the output from diff:

diff -uNr header.default header.php
--- header.default      Mon Jun 27 23:20:09 2005
+++ header.php  Tue Jul 19 18:30:46 2005
@@ -14,7 +15,8 @@
        <?php wp_head();?>

-<body><div id="container"<?php if (is_page() && !is_page("archives")) echo " class=\"singlecol\""; ?>>
+<body><div id="container"<?php if ( ((preg_match('/gallery/',$_SERVER['PHP_SELF'])) || is_page()) && !is_page("archives") ) echo " class=\"singlecol\""; ?>>
+<!-- banner ................................. -->

 <!-- header ................................. -->
<div id="header">
</div></div></body></div></body>

Step 4:
I created a new page for the gallery by going to Write -> Write Page in the dashboard. I selected ‘gallery’ as the page template and used ‘gallery’ as the page slug. I named my page ‘Flickr Galleries’ but you should be able to name it whatever you want.


No Responses to “Integrating the Flickr gallery plugin with the Blix Theme”  

  1. No Comments

Leave a Reply