• Resuelto guillem77

    (@guillem77)


    Hola,

    Tengo un problema con la alineación de un loop de un custom post type creado. Creo que es un tema que podría solucionar con css pero no doy con la solución. En la web podréis ver el problema rápidamente: https://democelta1.demoswp.com/testimonials/

    El codigo que he puesto es el siguiente:

    <?php
    /**
     * The template for displaying testimonials Category pages.
     *
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package GeneratePress
     */
     
    // No direct access, please
    if ( ! defined( 'ABSPATH' ) ) exit;
    
    get_header(); ?>
    
    <?php
    global $post;
    
    $args = array(
    
        'posts_per_page' => '',
        'offset' => 0,
        'category' => '',
        'category_name' => '',
        'orderby' => 'date',
        'order' => 'desc',
        'include' => '',
        'exclude' => '',
        'meta_key' => '',
        'meta_value' => '',
        'post_type' => 'testimonis',
        'post_mime_type' => '',
        'post_parent' => '',
        'author' => '',
        'author_name' => '',
        'post_status' => 'publish',
        'suppress_filters' => true );
    
    $myposts = get_posts( $args );
    
    foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
    
        <div class="testimonis-bloc">
            <div class="testimonis-contingut">
                <div class="pimage">
                    <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) {the_post_thumbnail();} ?></a>
                </div>
                <p class="testmonial-p"><?php the_content(); ?></p>
                <p class="testimonials-h2"><?php echo get_the_title(); ?></p>
                <p class="testimonial-country"><?php the_field('country'); ?></p>
                <div class="testimonials-socials">
    
                <?php $link = get_field('facebook'); if( $link ): ?><a href="<?php echo $link; ?>"><i class="fab fa-facebook-f"></i></span></a>
    
                <?php endif; ?><?php $link = get_field('Twitter'); if( $link ): ?><a href="<?php echo $link; ?>"><i class="fab fa-twitter"></i></span></span></a>
    
                <?php endif; ?><?php $link = get_field('Instagram');if( $link ): ?><a href="<?php echo $link; ?>"><i class="fab fa-instagram"></i></span></a><?php endif; ?>
            </div>
            </div>
        </div>
    
    <?php endforeach; wp_reset_postdata();
    
    get_footer();

    Y el CSS básico es:

    /*------archive testimonials---------*/
    
    .testimonis-bloc{
    	width: 50%;
    	float: left;
    }
    
    .testimonis-contingut{
    	padding: 40px;
    	margin: 30px;
    	float: left;
    	background-color: #ffffff;
    	filter: drop-shadow(5px 5px 10px #ddd);	
    
    }
    
    .pimage{
    	pointer-events: none;
    	cursor: default;
    }
    
    .testimonials-h2 {
    	float: left;
    	font-size: 16px;
    	font-style: italic;
    	margin-right: 10px;
    }
    
    .testimonial-country {
    	float: left;
    	font-size: 16px;
    	font-style: italic;
    	font-weight: 600;
    }
    
    .testimonials-socials{
    	float: right;
    	font-size: 16px;
    }
    

    Si me podéis ayudar os lo agradecería mucho. Hace tiempo que me encuentro con estos problemas de alineación en los grids y no doy con la solución.

    Guillem

    La página con la que necesito ayuda: [accede para ver el enlace]

Viendo 3 respuestas - de la 1 a la 3 (de un total de 3)
Viendo 3 respuestas - de la 1 a la 3 (de un total de 3)
  • El debate ‘Un loop en grid’ está cerrado a nuevas respuestas.