Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Configurar galeria de imagenes en WordPress

Estas en el tema de Configurar galeria de imagenes en WordPress en el foro de WordPress en Foros del Web. BUENAS AMIGOS Estoy trabajando en un sitio en wordpress donde tengo una galeria de imagenes que me muestra las imagenes en 4 columnas quisiera que ...
  #1 (permalink)  
Antiguo 11/07/2017, 21:04
 
Fecha de Ingreso: septiembre-2012
Mensajes: 38
Antigüedad: 11 años, 7 meses
Puntos: 0
Exclamación Configurar galeria de imagenes en WordPress

BUENAS AMIGOS

Estoy trabajando en un sitio en wordpress donde tengo una galeria de imagenes que me muestra las imagenes en 4 columnas quisiera que me mustre las imagenes en columnas de 2 y sucesivamente las demas esten abajo de igual manera de 2 en 2.

CODIGO PHP DE LA GALERIA DE IMAGENES:

Código PHP:
Ver original
  1. <?php global $post;
  2.  
  3. $kk_parallax = kk_parallax();
  4. $title_type = $kk_parallax[0];
  5. $bg_title_img = $kk_parallax[1];
  6. $grid_p = 'is_inner';
  7.  
  8. ?>
  9.  
  10. <?php if (have_posts()) : ?>
  11.     <?php while (have_posts()) : the_post(); ?>
  12.  
  13.         <?php if( $title_type == 'parallax' ) { ?>
  14.         <!-- start parallax container -->  
  15.         <div class="content clearfix">
  16.            
  17.         <div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
  18.            
  19.             <div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
  20.                 <img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="" />
  21.             </div>
  22.  
  23.             <div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
  24.                 <div id="kk-parallax-title" class="page-title">
  25.                     <?php the_title( '<h1>', '</h1>' ); ?>
  26.                 </div> 
  27.             </div>
  28.  
  29.             <a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
  30.        
  31.         </div> 
  32.         </div> 
  33.         <?php $grid_p = 'not_is_inner'; ?>
  34.         <?php } ?>
  35.                                
  36.             <?php if ( post_password_required( $post ) ) { ?>
  37.                 <div class="content-inner-wrapper clearfix">
  38.                     <?php echo get_the_password_form(); ?>
  39.                 </div>
  40.  
  41.             <?php } else { ?>  
  42.            
  43.     <!-- start gallery container -->   
  44.     <div class="fullmasonry grid-gal <?php echo esc_attr( $grid_p ) ?>">
  45.    
  46.         <span id="kk-to-me"></span>
  47.        
  48.         <!-- start gallery -->     
  49.         <div class="gallery-full-masonry">
  50.  
  51.             <ul class="masonry-container">
  52.             <?php
  53.                 $attachments = rwmb_meta( 'kk_imgadv', 'type=image_advanced' );                    
  54.                
  55.                 foreach ($attachments as $attachment) {
  56.        
  57.                     $koto_gridType = get_post_meta(get_the_ID(), '_grid_type_value', true);
  58.                     $ex = '';
  59.                    
  60.                     if ($koto_gridType == 'Landscape') {
  61.                         $tt = array(array(476,328));
  62.                         $ex = 'grid-landscape';
  63.                     } else if ($koto_gridType == 'Portrait') { 
  64.                         $tt = array(array(420,530));
  65.                         $ex = 'grid-portrait';
  66.                     } else if ($koto_gridType == 'Square') {   
  67.                         $tt = array(array(476,442));
  68.                         $ex = 'grid-square';
  69.                     } else if ($koto_gridType == 'Random') {   
  70.                         $tt = array(array(476,''));
  71.                         $ex = 'grid-random';
  72.                     };
  73.                    
  74.                     $tt=$tt[rand(0,(sizeof($tt)-1))];
  75.                     $featured_image = aq_resize($attachment['full_url'],$tt[0],$tt[1], true, false );   ?>
  76.                    
  77.                     <li id="<?php echo esc_attr($attachment['ID']) ?>" <?php post_class(array('masonry-box', $ex)); ?> >
  78.                         <div class="gallery-thumb">    
  79.                             <a class="kk-lightbox img-loading" data-group="kk-lightbox[<?php the_ID();?>]" href="<?php echo esc_url($attachment['full_url']) ?>" data-title="<?php echo esc_attr($attachment['title']) ?>" style="padding-bottom:<?php echo esc_attr( $featured_image[2]/$featured_image[1] * 100); ?>%">
  80.                                 <img class="doLazyLoad" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" width="<?php echo esc_attr( $featured_image[1] ); ?>" height="<?php echo esc_attr( $featured_image[2] ); ?>" data-original="<?php echo esc_url($featured_image[0]); ?>" title="<?php echo esc_attr($attachment['title']) ?>" alt="<?php echo esc_attr($attachment['alt']) ?>" />
  81.                                 <span class="kk-n"><?php _e('View','toppic'); ?></span>
  82.                             </a>
  83.                         </div>
  84.                     </li>
  85.                 <?php } ?>
  86.             </ul>
  87.         </div>
  88.         <!-- end gallery -->
  89.         <?php } ?>  
  90.        
  91.     </div>
  92.     <!-- end gallery container --> 
  93.    
  94.     <?php $content = get_the_content();
  95.             if(!empty($content)) { ?>
  96.            
  97.         <div class="info-fs-form kk-active-button">
  98.             <!-- start info close icon -->
  99.             <div class="kk-info-close">
  100.                     <span></span>
  101.             </div>
  102.             <!-- end info close icon -->
  103.             <div class="content-inner-wrapper">
  104.                 <div class="content-child">
  105.                     <?php the_content(); ?>
  106.                 </div>
  107.             </div>
  108.         </div>
  109.        
  110.     <?php } ?>
  111.    
  112. <?php endwhile; ?>
  113. <?php endif; ?>

Etiquetas: galeria, imagenes, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:13.