New answers tagged

0

The truth here is: while you surely can remove the posts you do not want to have in your loop or after querying, you can not do so without messing up the pagination. If you want a correct loop and pagination, you won't be able to get around post__not_in. However, if your query is not that complicated (like multiple meta queries additional to the post__not_in)...


0

If you're set to a static front page, why would there be pagination? The proper way to have a paginated grid of posts as your front page is to set the homepage to "Your latest posts". You would then develop your front-page.php, home.php or index.php template to display posts as a grid (use the Template Hierarchy to determine which file you need). In that ...


0

Thanks to all! I was needed to add parameter to pojo_paginate(): pojo_paginate( $custom_query )


1

If you go to the URL https://nadlancz.com/page/2/ you'll see that navigation works. What you need to do to see the navigation links is add something like this to your page <!-- Navigation --> <?php $pagination = get_the_posts_pagination(array( 'mid_size' => 2, 'prev_text' => 'Previous', 'next_text' => 'Next', ...


0

The problem could be a number of things. First of all, make sure you have more than 8 posts. If you do, then make sure you're pagination is working properly (numbered nav links to different pages should show up on page). Some more information would be helpful to better answer you question. Maybe a screenshot of the rendered page?


1

The code is in wp-includes/general-template.php. However there aren't any great options for styling the output: there's a hook for you to modify the link URL, but nothing else. Your best bet might be to call it in type=array mode $links = pagination_links([ "type" => "array" ]); which will return you an array of strings of links of the form <a ...


0

Change $loop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => -1 ) ); to e.g. $loop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => 9 ) ); If you set posts_per_page to -1 you will always pull all available posts. Hence, no pagination will show up since all posts are already shown on the first page.


0

You can use "mid_size" to manage number of pages to display in paginate_links() function. Please check https://developer.wordpress.org/reference/functions/paginate_links/ for pagination options. Please see example below to use mid_size. $args = array( 'mid_size' => 3, 'prev_next' => true, 'prev_text' => '« Previous', 'next_text' ...


1

If you have a form you should have a sort field in it, so that you can send your order value on form submit. This way you can send the sorting parameter to your backend callback function. If you don't have a form you shoud add this parameter to another element with a data attribute like that: <button id="load-more" data-order="DESC">Load More</...


Top 50 recent answers are included