wethead
Chevereto Member
Hi
Its not a huge plugin or anything, BUT if you want to show a gallery anywhere on your site add the following
Instant Gallery ( Latest Uploads )
We will be making a "Gallery Page"
You can also use this function in other places in your theme I.e home page / footer etc
Step One:
Create a new page called gallery.php in text editor:
Then add the following code:
Step Two:
Save as gallery.php
Step Three:
Upload gallery.php to your themes/YOURtheme/pages/
Step Four:
EDIT:
themes/YOURtheme/pages//pages_config.php
find:
add under:
If you want to style it, add this to your style.css
The function:
To change number of images to display edit: ( The bold )
b("images/thumbs/*.jpg"),0,60) as $thumb) {
ENJOY!
Here is a screenshot of what it will produce
Its not a huge plugin or anything, BUT if you want to show a gallery anywhere on your site add the following
Instant Gallery ( Latest Uploads )
We will be making a "Gallery Page"
You can also use this function in other places in your theme I.e home page / footer etc
Step One:
Create a new page called gallery.php in text editor:
Then add the following code:
Code:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
<div id="content" class="pages page_gallery">
<?php
$largeArray = glob("images/*.jpg");
$counter = 0;
foreach (array_slice(glob("images/thumbs/*.jpg"),0,60) as $thumb) {
echo ("<div class='thumbgall'><a href='$largeArray[$counter]'><img src='$thumb'/></a></div>");
$counter++;
}
?>
</div>
<?php include_theme_footer(); ?>
Step Two:
Save as gallery.php
Step Three:
Upload gallery.php to your themes/YOURtheme/pages/
Step Four:
EDIT:
themes/YOURtheme/pages//pages_config.php
find:
Code:
'contact' => array('live' => true, 'title' => 'Contact'),
add under:
Code:
'gallery' => array('live' => true, 'title' => 'Gallery'),
If you want to style it, add this to your style.css
Code:
.thumbgall{padding: 10px 5px 10px 5px;display:inline;}
The function:
To change number of images to display edit: ( The bold )
b("images/thumbs/*.jpg"),0,60) as $thumb) {
Code:
<?php
$largeArray = glob("images/*.jpg");
$counter = 0;
foreach (array_slice(glob("images/thumbs/*.jpg"),0,60) as $thumb) {
echo ("<div class='thumbgall'><a href='$largeArray[$counter]'><img src='$thumb'/></a></div>");
$counter++;
}
ENJOY!
Here is a screenshot of what it will produce