Finally I’ve figured out the correct coding for this problem:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$wp_query = new WP_Query();
$wp_query->query('tag=concurs&posts_per_page=".get_option("posts_per_page').'&paged=' . $paged);
?>
<?php if ($wp_query->have_posts()) : ?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
[code for title, author, category, meta-info etc]
<?php endwhile; ?>
<div class="next-prev"><?php posts_nav_link( ' ', '<img src="' . get_bloginfo('stylesheet_directory') . '/img/pagina-precedenta.png" align="left" />', '<img src="' . get_bloginfo('stylesheet_directory') . '/img/pagina-urmatoare.png" align="right" />'); ?></div>
<?php endif; ?>
Related Posts:
- Pagination when using wp_query?
- Find out total number of pages in global query on archive page?
- Post_count only shows the number of results per page
- Posts with at least 3 tags of a list of tags
- WordPress Pagination Not Working – Always Showing First Pages Content
- get_query_var function not working at all
- get_query_var( ‘paged’ ) not working outside of homepage
- Pagination returns 404 after page 20
- Combining two wordpress queries with pagination is not working
- How to paginate attachments in a secondary query as gallery?
- Given a WP_Query, how can I get a list of tags?
- Executing Queries in tag.php
- next_posts_link not working for loop called with ajax
- post_type is ignored by WP_Query when ‘tag’ argument is included
- Why does pagination always break when used on any form of a home page?
- Pagination shows 404 after a certain number of pages
- Pagination broken when merging search results with additional WP_Query
- Query with pre_get_posts to get pagination
- Pagination is not working using WP_Query
- Transient pagination not working properly
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Woocommerce custom loop to show all the products [closed]
- How to bring specific post to front of wordpress loop?
- Intentionally exceed max_num_pages on main query without getting 404?
- Pagination 404 errors for author posts query on author.php
- Too many posts cause slow load when paginating
- How to output different posts per page?
- Multiple WP_Query loops with Pagination Not Working
- Posts loop with pagination on a single post page
- Custom pagination with WP_Query generating 404 error
- Offset Page Loops and Pagination
- reducing the amount of wp_query calls
- WordPress Related Post by tags in Single.php
- Create A Loop With A Variable Number of Posts For Each Bootstrap Row?
- The pagination on index.php doesn’t work on a first page
- Include tags in WP_Query
- Display posts from only one post form in custom query and exclude in main query
- Get pagination working for custom loops within page templates
- pagination with ‘no_found_rows’ => true,
- how to handle multiple ajax wordpress queries?
- WordPress pagination not working using WP_Query
- Display tags with random thumbnail from selection of posts with that tag
- posts_per_page not working for first page of pagination
- Custom post type archive pagination query issue
- paged variable not working for category/custom post archive
- WordPress Blog Posts with Pagination inside a Page/Post
- Pagination only won’t work in author template
- wp query error while paging the posts
- Pagination works in custom query loop but it doesn’t work in shortcode
- “paged” in WP_Query returns 0 posts
- exclude product with available tag
- WP_Query by keyword OR post tag
- Notice thrown when creating numeric pagination on custom query
- Creating attachments archive in tags and categories
- Second loop pagination changes URL, not content
- Custom Homepage Pagination using WP_Query
- filter posts by meta key with pagination
- Pagination problem by using WP_Query
- Ajax (jquery) wp_query pagination returns -1
- Function the_posts_pagination() not compatible with WP_Query arguments
- adding pagination to a foreach loop in wordpress
- Pagination of custom page with custom fields query
- pre_get_posts pagination not working
- Pagination not working on archive.php template?
- Pagination inside the blog page not working
- Pagination on archive.php not working?
- Custom Query Pagination not working on static front page
- Search with WP_Query, but ignore href URLs in anchor tags?
- WordPress search page pagination displaying but not functional
- pagination functions are not working
- Paginated Post List on Front Page
- Exclude all tagged posts from WP_Query loop
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Pagination in WP_Query?
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Custom pagination (Title, date and teaser)
- Archive – Show Page Month Headers
- Query post Pagination Problem
- Add pagination to table generated by wp_query
- Pagination for custom query throws 404 errors on last pages [duplicate]
- Pagination is not working on custom query inside a custom home page template
- Pagination not working in some author pages
- How to add archives (with pagination) to page template?
- No content found on page 2 of pagination with 1 post per page
- What is wrong with this pagination code?
- Ordering Custom WP_Query loop by meta key value with pagination
- Limit Tags display and ad Drop Down Menu
- Loop being strainge
- Pagination in custom query not working [duplicate]
- paginate_links() on page (shortcode output)
- Paginate wp_query while utilizing post__not_in
- Get next post when using pagination with WP_Query?
- Duplicate posts showing up in loop using infinite scroll
- Pagination showing same posts despite changing page
- Pagination with Custom Post Type not working on index.php: I get a 404
- Pagination on custom post type not working
- Search results stuck on page 1
- Pagination only showed when no category is set in wp_query
- taxonomy-{term}.php terms pagination returning 404 after a certain page