Gallery Questions

Posted in: Newspaper
Post count: 76

Hey all, just a quick question. I know NewsPaper and Newsmag themes already have the lightbox functionality for single image, so hopefully this shouldn’t be too tedious to do. I wanted for each Gallery inserted into the post that it would open in a lightbox like seen here: http://thecurvyfashionista.com/2015/12/new-years-eve-plus-size-dress/ and the image attachments would show like they do in the ligthbox of the post example linked. It uses the default WordPress gallery with some php and css tweaks.

I see on that site they use the image.php or the attachment.php file and some css to do this, my question is, in NewsPaper’s attachment.php what would I need to tweak to possibly get it to sit in a similar layout for the galleries? Or would I need to create a separate file that only targets when galleries are added to a post? Please advise.

I can add in the php file code they are using:


<?php
/**
* @package WordPress
* @subpackage TCF2015
*/
get_header();

if ( have_posts() ) : while ( have_posts() ) : the_post();
//count total images + find current image number
global $post;
$attachments = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );

$count = count( $attachments );
$specific = array();
$i = 1;
?>

<section id="mainContent">

<div id="photoFull">

<?php $att_image = wp_get_attachment_image_src( $post->id, "full"); ?>
id); ?>" rel="attachment" target="_new">" alt="" />

</div><!-- END photoFull -->

<?php
foreach ( $attachments as $attachment ) {
$specific[$attachment->ID] = $i;
++$i;
}
if($specific[$post->ID] == $count) { ?>
<aside id="seeMore">

<div class="sectionheader"><h2>More Galleries</h2></div>

<div class="clear"></div>

</aside><!-- END seeMore -->
<? } ?>
</section><!-- END mainContent -->

<aside id="sidebar">

<div id="infoHeader">

<div id="controls">

<div id="prevNext">

<div id="prev"><?php previous_image_link() ?></div>

<div id="count">
<?php echo "{$specific[$post->ID]}/{$count}"; ?>
</div>

<div id="next"><?php next_image_link() ?></div>

</div><!-- END prevNext -->

<div id="closeButton">post_parent); ?>" rev="attachment"></div>

</div><!-- END controls -->

<h1>post_parent); ?>" rev="attachment"><?php the_title(); ?></h1>

</div><!-- END infoHeader -->

<?php the_content();?>

<div class="socialIcons">

</div><!-- END socialIcons -->

<div class="ad_300x250">

<?php echo do_shortcode( '[adrotate group="3"]' ); ?>

</div><!-- END ad_300x250 -->

</aside><!-- END sidebar -->

<?php endwhile; else: ?>
<?php endif; ?>

<?php get_footer(); ?>

What of this would be added in to the existing NewsPaper attachment.php file to help me get the desired gallery layout?

Thanks!

Post count: 6535

Hi

I looked over the code you provided and even if our theme already have the light box implemented you will need some serious customizations to achieve a similar functionality for the gallery like the one from the indicated link. This is a complex task and unfortunately I can’t provide a solution now. If you need this and you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you as we can’t offer customization services at the moment.

Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.