{"id":1906351,"date":"2011-02-09T14:08:47","date_gmt":"2011-02-09T14:08:47","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/jquery-get-post-on-multiple-page\/"},"modified":"2016-08-19T22:29:06","modified_gmt":"2016-08-19T22:29:06","slug":"jquery-get-post-on-multiple-page","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/jquery-get-post-on-multiple-page\/","title":{"rendered":"Jquery get post on multiple page"},"content":{"rendered":"<p>Hello, i&#8217;m bulding my first website and i made a menu where people can chose witch items they want to see. I displayed 25 items per page. My problem is when they chose an item exemple, Wood, well it only get all wood from the page 1 and not they other page&#8230;<\/p>\n<p>here is my php code<\/p>\n<pre><code>&lt;div id=&quot;les-photos&quot; class=&quot;clearfix&quot;&gt;\n\n\t&lt;?php\n\t\t\/\/in page, get children of this page and display with custom field &#039;cf1&#039;\/\n\n\t\t$parent_id = $posts[0]-&gt;ID;\n\t\t$args=array(\n\t\t&#039;post_parent&#039; =&gt; $parent_id,\n\t\t&#039;post_type&#039; =&gt; &#039;page&#039;,\n\t\t&#039;post_status&#039; =&gt; &#039;publish&#039;,\n\t\t&#039;posts_per_page&#039; =&gt; 24,\n\t\t&#039;caller_get_posts&#039;=&gt; 1,\n\t\t&#039;paged&#039; =&gt; $paged\n\t\t);\n\t\t$my_query = null;\n\t\t$my_query = new WP_Query($args);\n\t\tif( $my_query-&gt;have_posts() ) {\n\t\twhile ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;\n    &lt;?php $meta = get_post_meta($post-&gt;ID, &#039;photo1&#039;, true); ?&gt;\n\n    &lt;div class=&quot;&lt;?php echo get_post_meta($post-&gt;ID, &#039;Type&#039;, true); ?&gt;&quot;&gt;\n        &lt;div class=&quot;&lt;?php echo get_post_meta($post-&gt;ID, &#039;Materiel&#039;, true); ?&gt;&quot;&gt;\n            &lt;div class=&quot;&lt;?php echo get_post_meta($post-&gt;ID, &#039;Style&#039;, true); ?&gt;&quot;&gt;\n                &lt;div  id=&quot;port-photo&quot;&gt;\n                    &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; id=&quot;produit-hover&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;\n                    &lt;?php echo wp_get_attachment_image($meta, $size=array(150,150)); ?&gt;\n                    &lt;\/a&gt;\n                    &lt;div class=&quot;description&quot;&gt;\n                        &lt;p&gt;&lt;?php echo get_post_meta($post-&gt;ID, &#039;Type&#039;, true); ?&gt; \/ &lt;?php echo get_post_meta($post-&gt;ID, &#039;Materiel&#039;, true); ?&gt;&lt;\/p&gt;\n                        &lt;h2 class=&quot;photo-style&quot;&gt;&lt;?php echo get_post_meta($post-&gt;ID, &#039;Style&#039;, true); ?&gt;&lt;\/h2&gt;\n                    &lt;\/div&gt; &lt;!-- fin du div description --&gt;\n                &lt;\/div&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;&lt;!-- fin du port-photo --&gt;\n\n    &lt;?php endwhile;\n    }\n\n    wp_reset_query();  \/\/ Restore global post data stomped by the_post().\n    ?&gt;\n\n    &lt;\/div&gt;\n\n    &lt;div id=&quot;bas-portfolio&quot;&gt;\n\n    &lt;?php # $paged = (get_query_var(&#039;paged&#039;)) ? get_query_var(&#039;paged&#039;) : 1; ?&gt;\n    &lt;?php query_posts(&quot;paged=$paged&quot;); the_post(); ?&gt;\n\n    &lt;?php include (TEMPLATEPATH . &#039;\/inc\/nav.php&#039; ); ?&gt;\n\n\t&lt;?php wp_reset_query(); ?&gt;\n\n    &lt;\/div&gt;<\/code><\/pre>\n<p>and here is my jquery script<\/p>\n<pre><code>$(function() {\n\n\t\t$(&quot;#Cuisine&quot;).click(function()\n\t\t{\n\n\t\t\t$(&quot;.Cuisine&quot;).toggle();\n\n\t\t});\n});\n\n$(function() {\n\n\t$(&quot;#Mobilier&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Mobilier&quot;).toggle();\n\n\t});\n});\n\n$(function() {\n\n\t$(&quot;#Vanit\u00e9&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Vanit\u00e9&quot;).toggle();\n\n\t});\n\n});\t\t\t\t\t\n\n$(function() {\n\n\t$(&quot;#Bois&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Bois&quot;).toggle();\n\n\t});\n\n});\n\n$(function() {\n\n\t$(&quot;#Stratifi\u00e9&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Stratifi\u00e9&quot;).toggle();\n\n\t});\n\n});\n\n$(function() {\n\n\t$(&quot;#M\u00e9lamine&quot;).click(function()\n\t{\n\n\t\t$(&quot;.M\u00e9lamine&quot;).toggle();\n\n\t});\n\n});\n\n$(function() {\n\n\t$(&quot;#Polyester&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Polyester&quot;).toggle();\n\n\t});\n\n})\n\n$(function() {\n\n\t$(&quot;#laques&quot;).click(function()\n\t{\n\n\t\t$(&quot;.laques&quot;).toggle();\n\n\t});\n\n})\n\n$(function() {\n\n\t$(&quot;#Classi&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Classique&quot;).toggle();\n\n\t});\n\n})\n\n$(function() {\n\n\t$(&quot;#Comptem&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Comptemporain&quot;).toggle();\n\n\t});\n\n})\n\n$(function() {\n\n\t$(&quot;#Transi&quot;).click(function()\n\t{\n\n\t\t$(&quot;.Transitionnel&quot;).toggle();\n\n\t});\n\n})<\/code><\/pre>\n<p>Like i said this is my first website, so the code might not be perfect!<\/p>\n<p>Thanks for your help!!<\/p>\n","protected":false},"template":"","class_list":["post-1906351","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1906351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1906351\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1906351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}