Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post

$current_id = get_the_ID(); $cpt = get_post_type(); $all_ids = get_posts(array( ‘fields’ => ‘ids’, ‘posts_per_page’ => -1, ‘post_type’ => $cpt, ‘order_by’ => ‘post_date’, ‘order’ => ‘ASC’, )); $prev_key = array_search($current_id, $all_ids) – 2; $next_key = array_search($current_id, $all_ids) + 2; if(array_key_exists($prev_key, $all_ids)){ $prev_link = get_the_permalink($all_ids[$prev_key]); echo $prev_link; } if(array_key_exists($next_key, $all_ids)){ $next_link = get_the_permalink($all_ids[$next_key]); echo $next_link; } So I … Read more

How can I list all custom post types in a block

wp.data.select(‘core’).getPostTypes() will show return an array of objects that represent each registered post type that is available via the REST API. wp.apiFetch({path:’wp/v2/posts’}).then( res => console.log( res ) ); will retrieve the latest posts. You may want/need to update the parameters to suit your needs. See the docs for more details

Paginate_links won’t create the right links on a taxonomy filtered custom post type archive

If, for example, I click on the “2”, the page loaded as removed my taxonomy filter(s) and paginate navigation “max-page” looks like (seems to be) the number of pages non filtered by taxonomy It’s not that the (taxonomy) filters are removed from the pagination links, but instead, the filters are actually never added because the … Read more