More than one...
14 posts • Page 1 of 2 • 1, 2
More than one...
Is it possible to have more than one instance of the plugin in one blog?
- diasje
- Posts: 7
- Joined: Tue Apr 28, 2009 4:09 am
Re: More than one...
Actually, while not a "real feature" and not entirely a "duplicate gallery" but if you are looking to run multiple galleries that all feel and act the same way on the blog, but just with a different selection of photos, it can be done. Doing it now on a site that I can't show you, but it is happening.
AT YOUR OWN RISK, please don't ask me to support this. I am just sharing how I hacked it for my purposes. (multiple featured content galleries in the same blog is probably going to be added at some time in the future anyway)
1. duplicate the file gallery.php and call it something else, like gallery2.php
2. edit this line:
<?php query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items')); ?>
to read something where you hard-code the secondary category in, like:
<?php query_posts('category_name=secondary_category&showposts=' . get_option('gallery-items')); ?>
3. add articleimg like you did for your main gallery, only make sure the posts are in the new gallery.
4. add the line:
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery2.php'); ?>
to your page (or, in my case, I just made a page template and assigned the template to the page.
This is a bit messy and you can't mix and match transitions, timing, etc, but you can select which images are built on which gallery based on category. I suppose theoretically, you could build an endless number of content galleries this way, but maintaining is probably a bit messy and kinda runs counter to a "no hacks" methodology for WP plugins.. but, it works until the feature is eventually added... at least I hope it will be
AT YOUR OWN RISK, please don't ask me to support this. I am just sharing how I hacked it for my purposes. (multiple featured content galleries in the same blog is probably going to be added at some time in the future anyway)
1. duplicate the file gallery.php and call it something else, like gallery2.php
2. edit this line:
<?php query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items')); ?>
to read something where you hard-code the secondary category in, like:
<?php query_posts('category_name=secondary_category&showposts=' . get_option('gallery-items')); ?>
3. add articleimg like you did for your main gallery, only make sure the posts are in the new gallery.
4. add the line:
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery2.php'); ?>
to your page (or, in my case, I just made a page template and assigned the template to the page.
This is a bit messy and you can't mix and match transitions, timing, etc, but you can select which images are built on which gallery based on category. I suppose theoretically, you could build an endless number of content galleries this way, but maintaining is probably a bit messy and kinda runs counter to a "no hacks" methodology for WP plugins.. but, it works until the feature is eventually added... at least I hope it will be
- gerardmclean
- Posts: 1
- Joined: Sun Jun 21, 2009 8:45 am
Re: More than one...
I want to use a specific category id and all the children (the id is 277)
How do I change this code in gallery2.php
<?php query_posts('category_name=secondary_category&showposts=' . get_option('gallery-items')); ?>
How do I change this code in gallery2.php
<?php query_posts('category_name=secondary_category&showposts=' . get_option('gallery-items')); ?>
- befound
- Posts: 5
- Joined: Sat Jul 11, 2009 9:51 am
Re: More than one...
@befound - you just replace secondary_category with the NAME (not id) of your category.
If your category's slug is featured_post it would be
<?php query_posts('category_name=featured_post&showposts=' . get_option('gallery-items')); ?>
@gerardmclean This is amazing and worked perfectly, thank you so much!
If your category's slug is featured_post it would be
<?php query_posts('category_name=featured_post&showposts=' . get_option('gallery-items')); ?>
@gerardmclean This is amazing and worked perfectly, thank you so much!
- oh.amanda
- Posts: 4
- Joined: Thu Mar 12, 2009 8:59 am
Re: More than one...
Thanks for the prompt reply. Sadly I still get the same FCG photo selection as the home page. I have inserted the slug (http://www.lyshome.com/before-after-red ... g-gallery/)
Here's my code modified from gallery.php and I do call the new gallery from my page template:
<?php query_posts('category_name=before-after-redecorating-gallery&showposts=' . get_option('gallery-items')); ?>
Here's my code modified from gallery.php and I do call the new gallery from my page template:
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/before_after_gallery.php'); ?>
<div id="featured">
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true
});
}
window.addEvent('domready',startGallery);
</script>
<style type="text/css">
.jdGallery .slideInfoZone
{
height: <?php echo get_option('gallery-info'); ?>px;
}
</style>
<div id="myGallery">
<?php
$imgthumb = get_option('gallery-use-thumb-image') ? "thumbnailimg" : "articleimg";
$wordquantity = get_option('gallery-rss-word-quantity') ? get_option('gallery-rss-word-quantity') : 100;
if (get_option('gallery-way') == 'new') {//new way
$arr = split(",",get_option('gallery-items-pages'));
if (get_option('gallery-randomize-pages'))
{
shuffle($arr);
}
foreach ($arr as $post_or_page_id)
{
get_a_post($post_or_page_id); ?>
<div class="imageElement">
<h2><?php the_title() ?></h2>
<?php
if(get_option('gallery-use-featured-content')) {?>
<p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
<?php
} else {
?>
<p><?php the_content_rss('', 0, '', $wordquantity); ?></p>
<?php
}
?>
<a href="<?php the_permalink() ?>" title="Read More" class="open"></a>
<img src="<?php $key="articleimg"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="full" />
<img src="<?php $key=$imgthumb; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="thumbnail" />
</div>
<?php
} ?>
</div>
<?php
}
else { ?>
<?php $temp_query = $wp_query; ?>
<?php query_posts('category_name=before-after-redecorating-gallery&showposts=' . get_option('gallery-items')); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="imageElement">
<h2><?php the_title() ?></h2>
<?php
if(get_option('gallery-use-featured-content')) {?>
<p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
<?php
} else {
?>
<p><?php the_content_rss('', 0, '', $wordquantity); ?></p>
<?php
}
?>
<a href="<?php the_permalink() ?>" title="Read More" class="open"></a>
<img src="<?php $key="articleimg"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="full" />
<img src="<?php $key=$imgthumb; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="thumbnail" />
</div>
<?php endwhile; else: ?>
<?php endif; ?>
<?php $wp_query = $temp_query; ?>
</div>
<?php
}?>
</div>
- befound
- Posts: 5
- Joined: Sat Jul 11, 2009 9:51 am
Re: More than one...
Did you change the code in gallery.php also? If not, what settings are you using?
- V-V
- Posts: 1
- Joined: Thu Jul 30, 2009 6:38 am
Re: More than one...
I copied the gallery.php to before_after_gallery.php then I changed the before_after_gallery.php one line, bold below.
On the page I call:
The page for the 2nd gallery calls
I moved all the files into a folder: be-found.net/FCG so you can take a look if you would be so kind.
Maybe there are other files I need to modifiy.
BTW, I don't know what you mean by
I didn't make any changes to the gallery.php; only the new before_after_gallery.php (the copy of gallery.php)
On the page I call:
<?php query_posts('category_name=before-after-redecorating-gallery&showposts=' . get_option('gallery-items')); ?>
The page for the 2nd gallery calls
on line 15<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/before_after_gallery.php'); ?>
I moved all the files into a folder: be-found.net/FCG so you can take a look if you would be so kind.
Maybe there are other files I need to modifiy.
BTW, I don't know what you mean by
If not, what settings are you using?
I didn't make any changes to the gallery.php; only the new before_after_gallery.php (the copy of gallery.php)
- befound
- Posts: 5
- Joined: Sat Jul 11, 2009 9:51 am
Re: More than one...
Could anyone tell me what code I would change if I wanted to use a list of pages rather than a category? For example, page IDs 10, 38 and 45.
Thanks!
Thanks!
- slipshod
- Posts: 4
- Joined: Thu Sep 17, 2009 4:58 pm
Re: More than one...
Solved this. In case anyone is interested, I changed this line:
to
(Using the page ID examples I mentioned above). It seems to work fine.
$arr = split(",",get_option('gallery-items-pages'));
to
$arr = split(",",('10,38,45'));
(Using the page ID examples I mentioned above). It seems to work fine.
- slipshod
- Posts: 4
- Joined: Thu Sep 17, 2009 4:58 pm
Re: More than one...
If you want a category instead of specific posts/pages; do you know what the link would be changed to?
- befound
- Posts: 5
- Joined: Sat Jul 11, 2009 9:51 am
14 posts • Page 1 of 2 • 1, 2
Return to Plugin Settings, Features, and Options
Who is online
Users browsing this forum: No registered users and 0 guests









