remove_query_arg() on rewrite rule
http://codex.wordpress.org/Function_Reference/get_search_link was what I was looking for.
http://codex.wordpress.org/Function_Reference/get_search_link was what I was looking for.
for ($i=1; $i <= min($pages,10); $i++)
It’s a little bit of code, so I’ll ask you to take a look at this theme I did. It implements infinite scroll for the home page, category and tags, and i’ll soon implement this functionality for other types of listings like archives and search.
I believe the primary reason that the GET parameter format is still used for searches is that search forms are regular GET forms that when submitted form URLs with the GET parameters appended. But a further problem with using custom URLs to capture searches is that search terms can be arbitrary text, including slashes, etc, … Read more
Ok, Now this is particularly very odd…I found this forum post: http://wordpress.org/support/topic/error-404-on-pagination-when-changing-posts_per_page-on-query_posts Which basically says that if you are restricting the number of posts to a number less than 10 (which is the WordPress default), sometimes it can break pagination. To fix this issue, all you have to do is set the default number to … Read more
Try $u = 0; foreach($photos as $photo) { $u++; … if( ($params[‘next’] > 0 && $u == $params[‘next’]) ) { $retVal[‘content’] .= “<!–nextpage–>\n\n”; $u = 0; } EDIT (explaination) in the code posted by OP $params[‘next’] > 0 && $i == $params[‘next’] assuming $i is incremented every foreach cycle (this is not visible in the … Read more
You can post code directly into your question. You should edit the question to add your code so we don’t have to go looking for it. Plus if you ever delete that pastebin, this question is worthless to future users. You have registered the post type to have an archive, and then your template is … Read more
In function.php add_action(‘pre_get_posts’,’show_all_people’); function show_all_people( $query ) { if ( $query->is_main_query() && is_post_type_archive(‘people’) ) { $query->set(‘posts_per_page’, -1); } } See Codex docs for pre_get_posts hook
wp_reset_query(); resets the query to the original main query of the page. Therefore, storing the query in another variable is redundant and unnecessary. Updated code: $args = array( ‘cat’ => 15, ‘paged’ => $paged ); $custom_query = new WP_Query( $args ); while ($custom_query -> have_posts()) : $custom_query -> the_post(); endwhile; my_pagination(); //call function wp_reset_query(); //#3. … Read more
$archive_month = date(‘m’, strtotime(‘1 month ago’) ); $archive_year = date(‘Y’, strtotime(‘1 month ago’) ); echo ‘<a href=”‘ . get_month_link( $archive_year, $archive_month) . ‘”>Last month\’s posts</a>’;