{"id":62981,"date":"2017-08-10T22:15:45","date_gmt":"2017-08-10T22:15:45","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/entradas-de-slider-duplicadas-abajo\/"},"modified":"2017-08-10T22:16:48","modified_gmt":"2017-08-10T22:16:48","slug":"entradas-de-slider-duplicadas-abajo","status":"publish","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/entradas-de-slider-duplicadas-abajo\/","title":{"rendered":"Entradas de slider duplicadas abajo"},"content":{"rendered":"<p>Hola \ud83d\ude42 El problema que tengo es que las dos entradas del slider (arriba), que son las \u00faltimas publicadas, aparecen duplicadas abajo, donde necesito que solo est\u00e9n las entradas que siguen. Ya he probado todo tipo de eventuales soluciones de otros foros pero ninguna me ha funcionado \ud83d\ude41<\/p>\n<p>Este es el c\u00f3digo PHP del slider:<\/p>\n<pre><code>&lt;?php\n\t\t$args = array( \t\t\n\t\t\t\t&#039;tag_id&#039; =&gt; 17,\n\t\t\t\t&#039;posts_per_page&#039; =&gt; 2\n\t\t\t);\n\t\t$slide_posts = new WP_Query( $args );\n\t\t$exclude_posts = array();\n\n\t\t?&gt;\n\n\t\t&lt;h1 class=&quot;front-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title() ?&gt;&lt;\/a&gt;&lt;\/h1&gt;\n\t\t&lt;?php if ( $slide_posts-&gt;have_posts() ) : ?&gt;\n\t\t\t&lt;div dir=&quot;rtl&quot; class=&quot;slider single-item-rtl&quot;&gt;\n\t\t\t\t&lt;?php \/* Start the Loop *\/ ?&gt;\n\t\t\t\t&lt;?php \n\t\t\t\twhile ( $slide_posts-&gt;have_posts() ) : $slide_posts-&gt;the_post();\n\n\t\t\t\t\tarray_push($exclude_posts, get_the_ID());\n\n\t\t\t\t\tif (has_post_thumbnail()) :\n\t\t\t\t \t?&gt;\n\t\t\t\t\t&lt;div&gt;\n\t\t\t\t\t\t&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t&lt;?php the_post_thumbnail(&#039;wiral-lite-homepage-thumb-slider&#039;) ?&gt;\n\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;?php else : ?&gt;\n\t\t\t\t\t&lt;div&gt;\n\t\t\t\t\t\t&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t&lt;img src=&quot;&lt;?php echo esc_url( get_template_directory_uri() ) ?&gt;\/images\/default-slide.jpg&quot; alt=&quot;&lt;?php the_title() ?&gt;&quot; \/&gt;\n\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;?php \n\t\t\t\t\tendif;\n\t\t\t\tendwhile; \n\t\t\t\t?&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;?php else : ?&gt;\n\t\t\t&lt;?php get_template_part( &#039;content&#039;, &#039;none&#039; ); ?&gt;\n\t\t&lt;?php endif; ?&gt;\n\n\t\t&lt;?php wp_reset_postdata(); ?&gt;<\/code><\/pre>\n<p>Y este es el c\u00f3digo del index.php:<\/p>\n<pre><code>&lt;?php\ntheme_options = v4_options();\n$show_posts = new WP_Query( array( &#039;tag_id&#039; =&gt; 17, &#039;posts_per_page&#039; =&gt; 4 ) );\nget_header(); ?&gt;\n\n\t&lt;?php if( $theme_options[&#039;slider&#039;] == 1 &amp;&amp; (is_home() || is_front_page()) &amp;&amp; is_paged() == false) : ?&gt;\n\t&lt;div class=&quot;banner-section clearfix&quot;&gt;\n\t\t&lt;div class=&quot;banner&quot;&gt;\n\t\t\t&lt;?php get_template_part( &#039;template-parts\/content&#039;, &#039;slide&#039; ); ?&gt;\n\t\t&lt;div id=&quot;primary&quot; class=&quot;content-area posts-section&quot;&gt;\n\t\t&lt;main id=&quot;main&quot; class=&quot;site-main clearfix&quot; role=&quot;main&quot;&gt;\n\t\t\t&lt;div class=&quot;post-items clearfix&quot;&gt;\n\t\t\t&lt;?php if (  $show_posts-&gt; have_posts() ) : ?&gt;\n\n\t\t\t&lt;?php \/* Loop *\/ ?&gt;\n\t\t\t&lt;?php while ( $show_posts-&gt;have_posts() ) :  $show_posts-&gt;the_post(); ?&gt;\n\n\t\t\t\t&lt;?php\n\t\t\t\t\t\tget_template_part( &#039;template-parts\/content&#039;, get_post_format());\n                ?&gt;\n\n\t\t\t&lt;?php endwhile; ?&gt;\n\t\t\t&lt;?php else : ?&gt;\n\n\t\t\t\t&lt;?php get_template_part( &#039;template-parts\/content&#039;, &#039;none&#039; ); ?&gt;\n\n\t\t\t&lt;?php endif; ?&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;\/main&gt;\n\t&lt;\/div&gt;\n\t\t&lt;\/div&gt;\n\t\t&lt;div class=&quot;sidebar-home&quot;&gt;\n\t\t\t&lt;?php get_sidebar(&#039;home&#039;); ?&gt;\n\t\t&lt;\/div&gt;\n\t&lt;\/div&gt;\n\t&lt;?php endif; ?&gt;\n\t\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-62981","topic","type-topic","status-publish","hentry","topic-tag-slider"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/62981","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\/62981\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=62981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}