{"id":10166,"date":"2012-12-27T13:24:59","date_gmt":"2012-12-27T13:24:59","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/problema-con-wp_query\/"},"modified":"2016-08-06T00:16:40","modified_gmt":"2016-08-06T00:16:40","slug":"problema-con-wp_query","status":"closed","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/problema-con-wp_query\/","title":{"rendered":"Problema con WP_query"},"content":{"rendered":"<p>Ante todo un cordial saludo y mis mejores deseos en estas navidades a todos los miembros del foro.<\/p>\n<p>Busco su ayuda con un problema que me presenta el tema Wricker (real State), El tema lo descargue desde http:\/\/www.themesjunction.com\/theme\/wricker_wordpress_template-20959.html y fui adaptandolo poco hasta que he logrado obtener mas o menos lo que buscaba.<\/p>\n<p>El problema que se ha presentado a ultima hora, es que en la p\u00e1gina principal, deber\u00eda mostrar 5 inmuebles. En las pruebas en Local, los presenta sin problema, pero al subirlos al host, me aparece el desagradable mensaje: <strong>Sorry, no posts matched your criteria<\/strong><\/p>\n<p>Aqui suministro el c\u00f3digo que genera esta parte, a ver si alguien puede darme una idea del problema, pues llevo 3 d\u00edas tratando de encontrarlo y nada aun.<\/p>\n<p>De antemano, gracias!<\/p>\n<p>*******************************************<br \/>\n&lt;?php if (have_posts()) : ?&gt;<\/p>\n<p>&lt;?php $loop = new WP_Query(array(&#8216;post_type&#8217; =&gt; &#8216;wricker&#8217;, &#8216;posts_per_page&#8217; =&gt; 5)); ?&gt;<br \/>\n&lt;?php while ($loop-&gt;have_posts()): $loop-&gt;the_post(); ?&gt;<\/p>\n<p>&lt;div class=\u00bbpostindex\u00bb id=\u00bbpost-&lt;?php the_ID(); ?&gt;\u00bb&gt;<br \/>\n &lt;?php the_post_thumbnail(array(331,331), array (&#8216;class&#8217; =&gt; &#8216;thumbleft&#8217;)); ?&gt;<br \/>\n&lt;h2&gt;<a>\u00bb rel=\u00bbbookmark\u00bb title=\u00bb&lt;?php the_title(); ?&gt;\u00bb&gt;&lt;?php Limit_the_title(); ?&gt;<\/a>&lt;\/h2&gt;<\/p>\n<p>&lt;div class=\u00bbentry\u00bb&gt;<br \/>\n<strong>Direcci\u00f3n: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_address\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Precio: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_property-price\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Tipo de Propiedad: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_property-type\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Area (mts2): <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_square-feet\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Habitaciones: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_bedrooms\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Ba\u00f1os: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_bathroom\u00bb); echo $values[0]; ?&gt;<br \/>\n<strong>Amoblado: <\/strong>&lt;?php $values = get_post_custom_values(\u00abwricker_waterfront\u00bb); echo $values[0]; ?&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;?php<br \/>\n\t\t\t\t\tif($count == 4 ) {<br \/>\n\t\t\t\t\techo \u00ab&lt;div style=&#8217;clear:both;&#8217;&gt;&lt;\/div&gt;\u00bb;}<br \/>\n\t\t\t\t\t$count = $count+1;<br \/>\n\t\t\t\t\t?&gt;<\/p>\n<p>&lt;?php endwhile; else: ?&gt;<br \/>\n&lt;p&gt;&lt;?php _e(&#8216;Sorry, no posts matched your criteria.&#8217;); ?&gt;&lt;\/p&gt;<br \/>\n&lt;?php endif; ?&gt;<br \/>\n*************************************************************<\/p>\n","protected":false},"template":"","class_list":["post-10166","topic","type-topic","status-closed","hentry","topic-tag-loop","topic-tag-post","topic-tag-wp_query"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10166","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\/10166\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}