vecissitude
Forum Replies Created
-
function unblock_peipaging_nav() { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( "post_type" => "event", 'posts_per_page' => 2, 'paged' => $paged, ); $peiCorner = new WP_Query($args); echo "<nav class='pagination'><div class='nav-links'>"; echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => '%#%', 'current' => $paged, "total" => $peiCorner-> max_num_pages, 'prev_text' => is_rtl() ? '<i class="bi bi-caret-right-fill"></i>' : '<i class="bi bi-caret-left-fill"></i>', 'next_text' => is_rtl() ? '<i class="bi bi-caret-left-fill"></i>' : '<i class="bi bi-caret-right-fill"></i>', 'before_page_number' => '' )); echo "</nav></div>"; }Not really sure paged means, or base, or current, or format really means. I guess I got the values wrong somewhere. The posts do not seem to update with the links in the pagination what do I have wrong?
- This reply was modified 2 years, 10 months ago by vecissitude.
Forum: Developing with WordPress
In reply to: Adding pagination to 2nd custom post typesThanks that does seem to have made things better.
Forum: Developing with WordPress
In reply to: How to create pagination for custom post type?Thanks for the reply.
Here I created a staging site where you can see what I am working with: https://www.marcolapegna.com/staging/
Username:GenericUserPassword:Cupcake$%124
As you can see on the first blog in the main page pagination is working just fine. Then on the second blog I have in the PEI Corner tab it is not, I have 6 posts there and I am not getting pagination to show the 6th. The PEI Corner section is created in the child theme.
This is The Loop I have for the second blogfunction unblock_peiblog_styles() { $unblock_blog_style = apply_filters('unblock_blog_style', get_theme_mod('unblock_blog_style', 'classic-right')); $peiCorner = new Wp_Query(array( "posts_per_page" => 5, "post_type" => "event" )); // Start if ($peiCorner->have_posts()) : switch (esc_attr($unblock_blog_style)) { case "list": echo '<div class="column-wrapper blog-list">'; while ($peiCorner->have_posts()) : $peiCorner->the_post(); // Get the post summary get_template_part('template-parts/content/content', $unblock_blog_style !== 'classic-right' ? $unblock_blog_style : ''); endwhile; echo '</div>'; // Blog navigation unblock_peipaging_nav(); break;Notice how the function to add pagination is within The Loop. I pretty much copied the function from the parent theme and pasted it to the child theme.
Here is the function in main theme: https://github.com/xVicissitudex/WordPress-Themes/blob/main/unblock/inc/template-tags.php#L393
And here is function I made for child theme:https://github.com/xVicissitudex/WordPress-Themes/blob/main/unblock-child/template-tags.php#L5
For the life of me I can’t figure out why it does not work. Only thing I can think of is that somehow the_post_pagination only works with main query and you have to configure it somehow to work with custom posts.Ok I created the user as an “author” instead of administrator. I erased the site and created new clone and it seems to work if I create user as administrator.
Thanks for the reply.Forum: Fixing WordPress
In reply to: Not receiving reset password e-mail for loginSo what method do you advise I follow? I checked my rules on e-mail as well as blocked senders and nothing about wordpress was on there so i do not see why I should not be getting the reset e-mails.