Tag Info

Hot answers tagged

2

I think this is what you want. base is set via home_url(), format is page/%#%/, search query arg is added via add_args if it exists: $args = array( 'base' => home_url( '/%_%' ), 'format' => 'page/%#%/', 'current' => max( 1, get_query_var('paged') ), 'total' => $temp->max_num_pages, ); if( isset($_GET['s']) ){ ...


1

Regarding the number of pages displayed, read through the arguments for paginate_links, specifically end_size and mid_size. As for the 404- The problem is there is no page 3. Whether or not a page returns content or loads the 404 template is based on the results of the main query, not your custom query you run in the template. If this is a page post type, ...


1

You only see ten posts because that is the amount of posts per page set by default in the back end under 'Settings -> Reading -> Blog pages show at most' You can either set that to 14 to display all your 14 posts, or you can use pre get posts or WP_Query to alter the main query/create a custom query to change the number of posts shown on a page.


1

Use WP_Query instead, and you can use the meta_key / meta_value parameters: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'cat' => 10, 'paged' => $paged, 'posts_per_page' => 12, 'post_status' => 'any', 'order' => 'ASC', 'meta_key' => 'archived', 'meta_value' => 'true' ); ...


1

Add the next lines of code to functions.php file within active theme to start session. function example_login() { if ( ! session_id()) { session_start(); } } add_action( 'init', 'example_login' ); and then Use $_SESSION to store the value of $post



Only top voted, non community-wiki answers of a minimum length are eligible