{"id":89424,"date":"2019-04-26T14:26:52","date_gmt":"2019-04-26T14:26:52","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/un-loop-en-grid\/"},"modified":"2019-04-26T14:26:52","modified_gmt":"2019-04-26T14:26:52","slug":"un-loop-en-grid","status":"publish","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/un-loop-en-grid\/","title":{"rendered":"Un loop en grid"},"content":{"rendered":"<p>Hola,<\/p>\n<p>Tengo un problema con la alineaci\u00f3n de un loop de un custom post type creado. Creo que es un tema que podr\u00eda solucionar con css pero no doy con la soluci\u00f3n. En la web podr\u00e9is ver el problema r\u00e1pidamente:  https:\/\/democelta1.demoswp.com\/testimonials\/<\/p>\n<p>El codigo que he puesto es el siguiente: <\/p>\n<pre><code>&lt;?php\n\/**\n * The template for displaying testimonials Category pages.\n *\n * Learn more: https:\/\/codex.wordpress.org\/Template_Hierarchy\n *\n * @package GeneratePress\n *\/\n \n\/\/ No direct access, please\nif ( ! defined( &#039;ABSPATH&#039; ) ) exit;\n\nget_header(); ?&gt;\n\n&lt;?php\nglobal $post;\n\n$args = array(\n\n    &#039;posts_per_page&#039; =&gt; &#039;&#039;,\n    &#039;offset&#039; =&gt; 0,\n    &#039;category&#039; =&gt; &#039;&#039;,\n    &#039;category_name&#039; =&gt; &#039;&#039;,\n    &#039;orderby&#039; =&gt; &#039;date&#039;,\n    &#039;order&#039; =&gt; &#039;desc&#039;,\n    &#039;include&#039; =&gt; &#039;&#039;,\n    &#039;exclude&#039; =&gt; &#039;&#039;,\n    &#039;meta_key&#039; =&gt; &#039;&#039;,\n    &#039;meta_value&#039; =&gt; &#039;&#039;,\n    &#039;post_type&#039; =&gt; &#039;testimonis&#039;,\n    &#039;post_mime_type&#039; =&gt; &#039;&#039;,\n    &#039;post_parent&#039; =&gt; &#039;&#039;,\n    &#039;author&#039; =&gt; &#039;&#039;,\n    &#039;author_name&#039; =&gt; &#039;&#039;,\n    &#039;post_status&#039; =&gt; &#039;publish&#039;,\n    &#039;suppress_filters&#039; =&gt; true );\n\n$myposts = get_posts( $args );\n\nforeach ( $myposts as $post ) : setup_postdata( $post ); ?&gt;\n\n    &lt;div class=&quot;testimonis-bloc&quot;&gt;\n        &lt;div class=&quot;testimonis-contingut&quot;&gt;\n            &lt;div class=&quot;pimage&quot;&gt;\n                &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php if ( has_post_thumbnail() ) {the_post_thumbnail();} ?&gt;&lt;\/a&gt;\n            &lt;\/div&gt;\n            &lt;p class=&quot;testmonial-p&quot;&gt;&lt;?php the_content(); ?&gt;&lt;\/p&gt;\n            &lt;p class=&quot;testimonials-h2&quot;&gt;&lt;?php echo get_the_title(); ?&gt;&lt;\/p&gt;\n            &lt;p class=&quot;testimonial-country&quot;&gt;&lt;?php the_field(&#039;country&#039;); ?&gt;&lt;\/p&gt;\n            &lt;div class=&quot;testimonials-socials&quot;&gt;\n\n            &lt;?php $link = get_field(&#039;facebook&#039;); if( $link ): ?&gt;&lt;a href=&quot;&lt;?php echo $link; ?&gt;&quot;&gt;&lt;i class=&quot;fab fa-facebook-f&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;&lt;\/a&gt;\n\n            &lt;?php endif; ?&gt;&lt;?php $link = get_field(&#039;Twitter&#039;); if( $link ): ?&gt;&lt;a href=&quot;&lt;?php echo $link; ?&gt;&quot;&gt;&lt;i class=&quot;fab fa-twitter&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/a&gt;\n\n            &lt;?php endif; ?&gt;&lt;?php $link = get_field(&#039;Instagram&#039;);if( $link ): ?&gt;&lt;a href=&quot;&lt;?php echo $link; ?&gt;&quot;&gt;&lt;i class=&quot;fab fa-instagram&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;&lt;\/a&gt;&lt;?php endif; ?&gt;\n        &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n\n&lt;?php endforeach; wp_reset_postdata();\n\nget_footer();<\/code><\/pre>\n<p>Y el CSS b\u00e1sico es:<\/p>\n<pre><code>\/*------archive testimonials---------*\/\n\n.testimonis-bloc{\n\twidth: 50%;\n\tfloat: left;\n}\n\n.testimonis-contingut{\n\tpadding: 40px;\n\tmargin: 30px;\n\tfloat: left;\n\tbackground-color: #ffffff;\n\tfilter: drop-shadow(5px 5px 10px #ddd);\t\n\n}\n\n.pimage{\n\tpointer-events: none;\n\tcursor: default;\n}\n\n.testimonials-h2 {\n\tfloat: left;\n\tfont-size: 16px;\n\tfont-style: italic;\n\tmargin-right: 10px;\n}\n\n.testimonial-country {\n\tfloat: left;\n\tfont-size: 16px;\n\tfont-style: italic;\n\tfont-weight: 600;\n}\n\n.testimonials-socials{\n\tfloat: right;\n\tfont-size: 16px;\n}\n<\/code><\/pre>\n<p>Si me pod\u00e9is ayudar os lo agradecer\u00eda mucho. Hace tiempo que me encuentro con estos problemas de alineaci\u00f3n en los grids y no doy con la soluci\u00f3n.<\/p>\n<p>Guillem<\/p>\n","protected":false},"template":"","class_list":["post-89424","topic","type-topic","status-publish","hentry","topic-tag-css","topic-tag-grid"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/89424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/89424\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=89424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}