Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post

    Help with gallery html/css

    So I am trying to change the styling of a plugin I installed for for a gallery. Basically I want to change the thumbnails on the main gallery page so two or three sit side by side instead of one huge list.

    I am using the 1440px grid system and when I add threecol to the class it doesn't change anything. It saves fine but when I look in the source code of the website it isn't working.

    I am getting so frustrated and angry with this now as it makes no sense to me. I put 'tester' within the code as it shows that but not the class I add.

    Please can someone help me.

    Website address is here

    I will show the gallery pages code too here:-

    Code:
    <?php get_header(); ?>
    
    	<div id="container"> test gallery-single
    		<div role="main" id="content" class="ninecol last">
    			<?php 
    			global $post, $wp_query;
    			$args = array(
    				'post_type'					=> 'gallery',
    				'post_status'				=> 'publish',
    				'name'							=> $wp_query->query_vars['name'],
    				'posts_per_page'		=> 1
    			);	
    			$second_query = new WP_Query( $args ); 
    			$gllr_options = get_option( 'gllr_options' );
    			if ($second_query->have_posts()) : while ($second_query->have_posts()) : $second_query->the_post(); ?>
    				<h1 class="home_page_title"><?php the_title(); ?></h1>
    				<div class="gallery_box_single" class="threecol last">
    					<?php the_content(); 
    					$posts = get_posts(array(
    						"showposts"			=> -1,
    						"what_to_show"	=> "posts",
    						"post_status"		=> "inherit",
    						"post_type"			=> "attachment",
    						"orderby"				=> $gllr_options['order_by'],
    						"order"					=> $gllr_options['order'],
    						"post_mime_type"=> "image/jpeg,image/gif,image/jpg,image/png",
    						"post_parent"		=> $post->ID
    					));
    					if( count( $posts ) > 0 ) {
    						$count_image_block = 0; ?>
    						<div class="gallery clearfix">
    							<?php foreach( $posts as $attachment ) { 
    								$key = "gllr_image_text";
    								$link_key = "gllr_link_url";
    								$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'photo-thumb' );
    								$image_attributes_large = wp_get_attachment_image_src( $attachment->ID, 'large' );
    								$image_attributes_full = wp_get_attachment_image_src( $attachment->ID, 'full' );
    								if( 1 == $gllr_options['border_images'] ){
    									$gllr_border = 'border-width: '.$gllr_options['border_images_width'].'px; border-color:'.$gllr_options['border_images_color'].'';
    									$gllr_border_images = $gllr_options['border_images_width'] * 2;
    								}
    								else{
    									$gllr_border = '';
    									$gllr_border_images = 0;
    								}
    								if( $count_image_block % $gllr_options['custom_image_row_count'] == 0 ) { ?>
    								<div class="gllr_image_row">
    								<?php } ?>
    									<div class="gllr_image_block">
    										<p style="width:<?php echo $gllr_options['gllr_custom_size_px'][1][0]+$gllr_border_images; ?>px;height:<?php echo $gllr_options['gllr_custom_size_px'][1][1]+$gllr_border_images; ?>px;">
    											<?php if( ( $url_for_link = get_post_meta( $attachment->ID, $link_key, true ) ) != "" ) { ?>
    												<a href="<?php echo $url_for_link; ?>" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" target="_blank">
    													<img style="width:<?php echo $gllr_options['gllr_custom_size_px'][1][0]; ?>px;height:<?php echo $gllr_options['gllr_custom_size_px'][1][1]; ?>px; <?php echo $gllr_border; ?>" alt="" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" src="<?php echo $image_attributes[0]; ?>" />
    												</a>
    											<?php } else { ?>
    											<a rel="gallery_fancybox" href="<?php echo $image_attributes_large[0]; ?>" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" >
    												<img style="width:<?php echo $gllr_options['gllr_custom_size_px'][1][0]; ?>px;height:<?php echo $gllr_options['gllr_custom_size_px'][1][1]; ?>px; <?php echo $gllr_border; ?>" alt="" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" src="<?php echo $image_attributes[0]; ?>" rel="<?php echo $image_attributes_full[0]; ?>" />
    											</a>
    											<?php } ?>											
    										</p>
    										<div  style="width:<?php echo $gllr_options['gllr_custom_size_px'][1][0]+$gllr_border_images; ?>px; <?php if( 0 == $gllr_options["image_text"] ) echo "visibility:hidden;"; ?>" class="gllr_single_image_text"><?php echo get_post_meta( $attachment->ID, $key, true ); ?>&nbsp;</div>
    									</div>
    								<?php if($count_image_block%$gllr_options['custom_image_row_count'] == $gllr_options['custom_image_row_count']-1 ) { ?>
    								</div>
    								<?php } 
    								$count_image_block++; 
    							} 
    							if($count_image_block > 0 && $count_image_block%$gllr_options['custom_image_row_count'] != 0) { ?>
    								</div>
    							<?php } ?>
    							</div>
    						<?php } ?>
    					</div>
    					<div class="clear"></div>
    				<?php endwhile; else: ?>
    				<div class="gallery_box_single">
    					<p class="not_found"><?php _e('Sorry - nothing to found.', 'gallery'); ?></p>
    				</div>
    				<?php endif; ?>
    				<?php if( 1 == $gllr_options['return_link'] ) {
    					if( 'gallery_template_url' == $gllr_options["return_link_page"] ){
    						global $wpdb;
    						$parent = $wpdb->get_var( "SELECT $wpdb->posts.ID FROM $wpdb->posts, $wpdb->postmeta WHERE meta_key = '_wp_page_template' AND meta_value = 'gallery-template.php' AND (post_status = 'publish' OR post_status = 'private') AND $wpdb->posts.ID = $wpdb->postmeta.post_id" );	?>
    						<div class="return_link"><a href="<?php echo ( !empty( $parent ) ? get_permalink( $parent ) : '' ); ?>"><?php echo $gllr_options['return_link_text']; ?></a></div>
    					<?php } else { ?>
    						<div class="return_link"><a href="<?php echo $gllr_options["return_link_url"]; ?>"><?php echo $gllr_options['return_link_text']; ?></a></div>
    					<?php }
    				} ?>
    			</div>
    		</div>
    	<script type="text/javascript">
    		(function($){
    			$(document).ready(function(){
    				$("a[rel=gallery_fancybox]").fancybox({
    					'transitionIn'		: 'elastic',
    					'transitionOut'		: 'elastic',
    					'titlePosition' 	: 'inside',
    					'speedIn'					:	500, 
    					'speedOut'				:	300,
    					'titleFormat'			: function(title, currentArray, currentIndex, currentOpts) {
    						return '<span id="fancybox-title-inside">' + (title.length ? title + '<br />' : '') + '<?php _e( "Image ", "gallery"); ?>' + (currentIndex + 1) + ' / ' + currentArray.length + '</span><?php if( get_post_meta( $post->ID, 'gllr_download_link', true ) != '' ){?><br /><a href="'+$(currentOpts.orig).attr('rel')+'" target="_blank"><?php echo __('Download High resolution image', 'gallery'); ?> </a><?php } ?>';
    					}<?php if( $gllr_options['start_slideshow'] == 1 ) { ?>,
    					'onComplete':	function() {
    						clearTimeout(jQuery.fancybox.slider);
    						jQuery.fancybox.slider=setTimeout("jQuery.fancybox.next()",<?php echo empty( $gllr_options['slideshow_interval'] )? 2000 : $gllr_options['slideshow_interval'] ; ?>);
    					}<?php } ?>
    				});
    			});
    		})(jQuery);
    	</script>
        
       </div><!--/#main-stage-->
       
    <?php get_footer(); ?>

    Code:
    <?php
    /*
    Template Name: Gallery Template
    */
    ?>
    
    <?php get_header(); ?>
    
    
    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the wordpress construct of pages
     * and that other 'pages' on your wordpress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Boilerplate
     * @since Boilerplate 1.0
     */
    get_header(); ?>
    
    <div id="main-content" class="ninecol last"> 
    
    
            
            
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	                <h1 class="entry-title"><?php the_title(); ?></h1>
    					<div class="entry-content"> tester
    						<?php the_content(); ?>
    						<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'boilerplate' ), 'after' => '' ) ); ?>
    						<?php edit_post_link( __( 'Edit', 'boilerplate' ), '', '' ); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-## -->
                    
                    <div class="gallery_box">
    				<ul>
    				<?php 
    					global $post;
    					global $wpdb;
    					global $wp_query;
    					$paged = $wp_query->query_vars["paged"];
    					$permalink = get_permalink();
    					$gllr_options = get_option( 'gllr_options' );
    					if( substr( $permalink, strlen( $permalink ) -1 ) != "/" )
    					{
    						if( strpos( $permalink, "?" ) !== false ) {
    							$permalink = substr( $permalink, 0, strpos( $permalink, "?" ) -1 )."/";
    						}
    						else {
    							$permalink .= "/";
    						}
    					}
    					$count = 0;
    					$args = array(
    						'post_type'					=> 'gallery',
    						'post_status'				=> 'publish',
    						'orderby'						=> 'post_date',
    						'posts_per_page'		=> -1
    					);
    					$second_query = new WP_Query( $args );
    					if ( function_exists( 'pdfprnt_show_buttons_for_custom_post_type' ) ) echo pdfprnt_show_buttons_for_custom_post_type( $second_query );
    					$count_all_albums = count($second_query->posts);
    					$per_page = $showitems = get_option( 'posts_per_page' );  
    					if( $paged != 0 )
    						$start = $per_page * ($paged - 1);
    					else
    						$start = $per_page * $paged;
    					if ($second_query->have_posts()) : while ($second_query->have_posts()) : $second_query->the_post();
    						if( $count < $start ) {
    							$count++;
    							continue;
    						}
    						if( ( $count - $start ) > $per_page - 1 )
    							break;
    
    					$attachments	= get_post_thumbnail_id( $post->ID );
    					if( empty ( $attachments ) ) {
    						$attachments = get_children( 'post_parent='.$post->ID.'&post_type=attachment&post_mime_type=image&numberposts=1' );
    						$id = key($attachments);
    						$image_attributes = wp_get_attachment_image_src( $id, 'album-thumb' );
    					}
    					else {
    						$image_attributes = wp_get_attachment_image_src( $attachments, 'album-thumb' );
    					}
    					if( 1 == $gllr_options['border_images'] ){
    						$gllr_border = 'border-width: '.$gllr_options['border_images_width'].'px; border-color:'.$gllr_options['border_images_color'].'; padding:0;';
    						$gllr_border_images = $gllr_options['border_images_width'] * 2;
    					}
    					else{
    						$gllr_border = 'padding:0;';
    						$gllr_border_images = 0;
    					}
    					$count++;
    				?>
    					
    				<?php endwhile; endif; wp_reset_query(); ?>
    				</ul>
    				<?php
    					if( $paged == 0 )
    							$paged = 1;
    					$pages = intval ( $count_all_albums/$per_page );
    					if( $count_all_albums % $per_page > 0 )
    						$pages +=1;
    					$range = 100;
    					if( ! $pages ) {
    						$pages = 1;
    					}
    					if( 1 != $pages ) {
    						echo "</div><div class='clear'></div><div class='pagination'>";
    						for ( $i = 1; $i <= $pages; $i++ ) {
    							if ( 1 != $pages && ( !( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
    								echo ( $paged == $i ) ? "<span class='current'>". $i ."</span>":"<a href='". get_pagenum_link($i) ."' class='inactive' >". $i ."</a>";
    							}
    						}
    
    						echo "<div class='clear'></div></div>\n";
    					} else {?>
    						</div>
    					<?php } ?>
    		</div>
    	
                    </div><!--/#main-stage-->
        
    <?php endwhile; ?>
    <?php get_footer(); ?>
    Last edited by charlyanderson; 02-11-2013 at 08:59 PM.

  • #2
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Aaah found it at last, there was another file attached to the plugin with the code that needed changing


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •