<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Search Custom in Wordpress + Genesis]]></title><description><![CDATA[<p dir="auto">Buongiorno sto provando a realizzare la pagina di ricerca personalizzata in Wordpress, utilizzando Genesis. Solo che nella creazione della paginazione utilizzando la funzione paginate_links() riscontro il seguente problema.<br />
Se inserisco global $wp_query i numeri delle pagine scompaiono, se lo tolgo i numeri delle pagine compaiono ma se clicco su 2 o 3 mi da errore 404. Sinceramente non riesco a comprendere dov'è l'errore, se potete darmi qualche piccola indicazione, vi ringrazio per l'attenzione.</p>
<pre><code>$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  $s = isset( $_GET["s"] ) ? $_GET["s"] : "";
  $args = (array(
    's' =&gt; $s,
    'posts_per_page' =&gt; 3,
    'paged' =&gt; $paged,
  ));
  $wp_query = new WP_Query( $args );
  ?&gt;
  &lt;div class="container-search"&gt;
  &lt;?php
  if ( $wp_query-&gt;have_posts() ) {
    $startpost=1;
    $startpost=3*($paged - 1)+1;
    $endpost = (3*$paged &lt; $wp_query-&gt;found_posts ? 3*$paged : $wp_query-&gt;found_posts);
    ?&gt;
      &lt;div class="result"&gt;
        &lt;h2&gt;You searched for: &lt;?php echo $s ?&gt;&lt;/h2&gt;
        &lt;p&gt;Displayed results: from &lt;strong&gt;&lt;?php echo $startpost; ?&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;?php echo $endpost; ?&gt;&lt;/strong&gt; of &lt;strong&gt;&lt;?php echo $wp_query-&gt;found_posts; ?&gt;&lt;/strong&gt; total&lt;/p&gt;
      &lt;/div&gt;
    &lt;?php
      while ( $wp_query-&gt;have_posts() ) : $wp_query-&gt;the_post();
      ?&gt;
      &lt;article class="search"&gt;
        &lt;h3&gt;&lt;?php echo get_the_title(); ?&gt;&lt;/h3&gt;
        &lt;span class="url"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_permalink(); ?&gt;&lt;/a&gt;&lt;/span&gt;
        &lt;p&gt;&lt;?php echo get_the_excerpt(); ?&gt;&lt;/p&gt;
      &lt;/article&gt;
      &lt;?php
      endwhile;
      global $wp_query;
      $big = 999999999;
      echo paginate_links(array(
        'base' =&gt; str_replace( $big, '%#%', esc_url(get_pagenum_link($big))),
	      'format' =&gt; '?paged=%#%',
	      'current' =&gt; $paged,
        'total' =&gt; $wp_query-&gt;max_num_pages,
        'prev_text'       =&gt; __('&amp;laquo;'),
        'next_text'       =&gt; __('&amp;raquo;')
      ));


      wp_reset_postdata();
</code></pre>
]]></description><link>https://dev.connect.gt/topic/233193/search-custom-in-wordpress-genesis</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 15:51:47 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/233193.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Jan 2018 08:56:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Search Custom in Wordpress + Genesis on Mon, 29 Jan 2018 16:09:15 GMT]]></title><description><![CDATA[<p dir="auto">Ho risolto, modificando le impostazioni nel backend di wordpress.</p>
<p dir="auto">Impostazioni -&gt; Lettura -&gt; Numero  Articoli Recenti. Si deve inserire, lo stesso numero inserito nel parametro posts_per_page (wp_query).</p>
]]></description><link>https://dev.connect.gt/post/1245369</link><guid isPermaLink="true">https://dev.connect.gt/post/1245369</guid><dc:creator><![CDATA[jamesweb]]></dc:creator><pubDate>Mon, 29 Jan 2018 16:09:15 GMT</pubDate></item></channel></rss>