Framing Gallery2 Into WordPress
Here we go on another adventure in the world of websites and code that I know nothing about. One of the major features that I wanted to add to this site was to have my gallery embedded or at least appear to be embedded. There is a plug-in called WPG2 which does exactly that – properly. You may want to go ahead and check it out before you read any further. My method simply adds the gallery via an iframe. It does not integrate the gallery with WordPress.
I started by creating a new page and pasting a bit of code from another site that had an iframe. This is the snippet of code that I copied and pasted:
<p><iframe src="http://YourGalleryURLHere" id="searchFrame" frameborder="0" height="1030" width="725"></iframe></p>
You can adjust the height and width to make the iframe fit into your theme. And depending on your theme, some of you may be done at this point. My theme, however, was not so accommodating. The right sidebar was in the way.
I fixed this by creating a custom page to eliminate the right sidebar. The first step is to create a new template page in your wp-content/themes folder. Give it a name. Mine is called custom.php. Add the following code to the top of this file:
<?php
/*
Template Name: Custom
*/
?>
Next, I copied the code from my page.php file and put it into my new custom.php file. Then I looked for the code that pertained to the right sidebar. This is what it looked like:
<?php include (TEMPLATEPATH . '/r_sidebar.php'); ?>
I commented out this line of code. Next I had to edit the Gallery page that I had created in WordPress to use the new custom page. Go to Manage>Pages>Gallery>Edit and on the right side under Page Template choose your custom page. Save & done. Bye-bye right sidebar.
I then went to the gallery administration and chose a theme that best suited my WordPress theme. In my case, I chose the Siriux theme. I also eliminated all of the blocks that show on the album pages in the theme’s settings. A little tweaking with the height and width and now I have my gallery framed into my site.
Check it out: Gallery
Comments
One Response to “Framing Gallery2 Into WordPress”
Leave a Reply





Cool. when I get off my lazy ass and finish my homework I’ll have to try this out