I have a page showing a grid of featured images, which individually link to the post attachment using a fancybox.
Is it possible to open multiple post attachments (all the images in the featured gallery) in a fancybox also? while showing only the first image as a thumbnail.
I’m trying to get the attachment link as follows, so far unsuccessfully.
<?php $galleryarray = get_post_gallery_ids($post->ID,1);
foreach ($galleryarray as $id) {
$imagesize = wp_get_attachment_image_src( $id, 'thumb' );
$attachment_meta = wp_get_attachment( $id );
?>
<a id="<?php echo $id; ?>" href="<?php echo $imagesize[0]; ?>">
<img src="<?php echo wp_get_attachment_url( $id ); ?>">
<?php echo '</a>';?>
<?php } ?>
Any help much appreciated,
thanks.
https://www.ads-software.com/plugins/featured-galleries/
]]>Heres my code…
<?php
function getHouseFourSlider($post_id){
$galleryArray = get_post_gallery_ids($post_id);
if(empty($galleryArray) || !isset($galleryArray[0]) || empty($galleryArray[0])){
return false;
}
?>
<style type="text/css">
/*
https://www.sitepoint.com/maintain-image-aspect-ratios-responsive-web-design/
*/
.rp-big-one-content {
background-color: #ededed;
display: block;
width: 100%;
position: relative;
height: 0;
/*
Padding percentage = (landscape image height)/(landscape image width)*100
*/
padding: 66.65% 0 0 0;
overflow: hidden;
}
.flexslider img
{
position: absolute;
display: block;
max-width: 100%;
max-height: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
</style>
<div id="featured-content" class="flexslider">
<ul class="featured-posts slides">
<?php
foreach ($galleryArray as $id) {
//echo wp_get_attachment_url( $id );
?>
<li id="post-<?=$id?>" class="rp-big-one featured cf" ?>
<div class="rp-big-one-content">
<div class="entry-thumb">
<img src="<?=wp_get_attachment_url( $id )?>" class="attachment-zuki-fullwidth wp-post-image" alt="An2.1" />
</div><!-- end .entry-thumb -->
</div><!--end .rp-big-one-content -->
<?php echo wp_get_attachment_metadata( $id ); ?>
</li><!--end .rp-big-one -->
<?php
}
?>
</ul><!-- .featured-content-inner -->
</div><!-- #featured-content .featured-content -->
<?php
return true;
}
i tried adding <?php echo wp_get_attachment_metadata( $id ); ?>
but just got the word Array appearing. Any basic help would be great.
Please help!
Thanks.
Jon
]]>Is it possible to have a “featured nextGEN gallery”? I would like to have more control over my design and would like to get the gallery as i would do a featured image.
Tanks.
https://www.ads-software.com/plugins/nextgen-gallery/
]]>I’ve a sticky post on my blog. But the theme I’m using is coded to show the post excerpts immediately after the featured gallery and hence it is not showing my sticky post. Now what I want is (on the home page) to show my sticky post immediately after the featured gallery and before the post excerpts. I want this to be shown exactly as it shows as a single post but in between the featured gallery and post excerpts.
I’m pasting the whole index.php file here –
<?php get_header(); ?>
<div id="content_area"><!--content_area-->
<div class="banner">
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
</div>
----------------------------------------------------------------
I want the sticky post here exactly as it shows as a single post
---------------------------------------------------------------
<div class="review_title"><h2>Reviews</h2></div>
<?php
$limit = get_option('posts_per_page');
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'meta_key' => 'dbt_show',
'meta_value' => 1,
'showposts'=> $limit,
'paged' => $paged,
);
query_posts($args);
global $more;
$more = 0;
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post"><!--post-->
<div class="img_box">
<?php $thumb_img = get_post_meta($post->ID, 'dbt_thumb', true);?>
<?php if($thumb_img) : ?><img src="<?php bloginfo( 'template_url' ); ?>/tools/timthumb.php?src=<?php echo $thumb_img; ?>&w=148&h=148&zc=1" alt="" /><?php else : $thumb_img = get_bloginfo('template_url').'/images/img_01.jpg'; ?><img src="<?php bloginfo( 'template_url' ); ?>/tools/timthumb.php?src=<?php echo $thumb_img; ?>&w=148&h=148&zc=1" alt="" /><?php endif ?>
</div>
<div class="review_box_title">
<h2><a href="<?php the_permalink(); ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="star_box">
<?php $rating = get_post_meta($post->ID, 'dbt_stars', true);
for($i=0; $i<$rating; $i++)
{ ?>
<img src="<?php bloginfo('template_url');?>/images/star_img.jpg" alt="" />
<?php }
?>
</div>
</div>
<div class="review_entry" style=" border:1px solid red;"><!--review_entry-->
<?php the_excerpt(''); ?>
<div class="button_box_area"><!--button_box_area-->
<div class="button_box_lft">
<a href="<?php the_permalink(); ?>" title=""><span><span>READ REVIEW</span></span></a>
</div>
<div class="button_box_rgt">
<a href="<?php echo get_post_meta($post->ID, 'dbt_website', true); ?>" title=""><span><span>VIEW</span></span></a>
</div>
</div><!--/button_box_area-->
</div><!--/review_entry-->
</div><!--/post-->
<?php endwhile; ?>
<div class="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
<?php endif; wp_reset_query(); ?>
</div><!--/content_area-->
<?php include(TEMPLATEPATH.'/sidebar.php') ?>
<?php get_footer(); ?>
Thanks in advance
]]>Seems too cumbersome for my client to have to use 2 or 3 images to use in one post.
]]>Do anyone know how to fix this problem?
]]>I’m using the standard gallery in WordPress 2.7.
Does anyone know how to display featured galleries without using a plugin such as NextGEN Gallery to manage the images.
I simply want to display a group of thumbnails for the posts that do contain a gallery in the sidebar.
something like this in the right sidebar under Featured Galleries: https://www.joystiq.com/
]]>How can I fix this?
Plugin page:
https://www.wpelements.com/2008/02/28/the-featured-content-gallery-plugin/