I am going to assume you’ve got blog.php?page=2 working since you stated that’s what you wanted. It seems like you might have to pull off a lot of magic to hide /blog/ from your users. Not sure why you want that, so I’m going to ignore that and just give you a solution that might work.
I don’t see a function to grab the current page. If one exists, you could add one and then just hard code the nav links in your theme. You’ll need a little logic to be sure you’re not sending to a page that doesn’t exist ( are you on the last page already? )
You could also parse the number off of the get_next_posts_link() to get the number and go from there. Something like
$parts=split('" >',get_next_posts_link());
$numparts=split('=',$parts[0]);
$number=$numparts[-1];
should do the trick.
should give you an array where item 0 is
Related Posts:
- What’s the difference between home_url() and site_url()
- Prevent “main” WPMU site_url() being returned in functions
- Custom page with variables in url. Nice url with add_rewrite_rule
- Is it possible to use a forgot password url filter?
- Create Custom URL structure for specific Post category
- How can I rename the WordPress AJAX URL? [duplicate]
- Ninja form Redirect depending on text field content [closed]
- wp-comment author- url +, email filter hook
- Removing custom meta data
- WordPress on AWS Auto scaling and ELB giving 503
- WordPress converts media extention URL automatically to video player
- meta tags doesnt fetch data from permalinks
- Get arguments from URL
- Add unique id to Preview URL
- How can I set the SRC URL of the custom logo image?
- Need to convert image url to a Base_64 data url with wordpress function..
- Protect get_query_var from manual input in url
- Problem with images URL after filter applying
- How i can get the URL?
- include w_thumbnail_src in function?
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Fetch URL parameter
- how can I change all wordpress media file url to custom cdn url?
- Custom route and extract data from slashes and parameter
- reWrite wp-content url to point on my cdn
- How to Override Page Template if URL matches query?
- Add #primary at the end of navlink permalinks on single posts
- Set URL Parameter Post Layout As Default
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Instead of using $post, how do i get the thumbnail image of the $post
- How to add a meta information to the URL?
- Function in functions.php by url
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to add a data attribute to a WordPress menu item
- Link to user’s profile settings page?
- Order posts (across the whole site) by metadata date
- Functions.php code that only runs on localhost?
- hook a functions to change wp-config from functions.php
- Relative URLs and hide /wp-content/themes/
- Disable visual editor on one specific page
- Shared functions.php across multiple WordPress websites
- How to restrict actions and filters “properly” by conditions
- Extending auth_cookie_expiration based on user role
- Check if the user has explicitly set an excerpt
- How to display random users with avatars
- AJAX handler throws 400 (Bad request) – why?
- Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Slugs as breadcrumbs for Pages
- Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?
- Removing Unnecessary Text from Admin Menu without CSS
- Conditional tag is_page with a custom post type
- Add inline css to theme
- Shortcode with custom content attribute?
- Add a Post Thumbnail to an RSS Feed with custom size
- Display WordPress Search
- Automatically add author’s name to post_tag
- Print Dashboard menu name and link
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- Preferred Use of home_url()?
- Enqueue styles after a plugin
- Develop function get_template_part in functions.php
- Where does function_exists() look to decide whether a function exists? [closed]
- Change comment_reply_link URL
- Ajaxing function in widget class
- Clean-up script tags
- Make “sidebar template” the default template for new pages
- Refactor create_function
- Super simple shortcode not working
- WordPress function for 1 to for many
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Attach parent category template to all subcategories
- Using “Read More” link with custom excerpt
- How can you limit srcset on a single type of page?
- Remove Font-Awesome MaxCDN Link & Load Locally
- How to remove howdy dropdown menu content
- How to fix Warning: call_user_func_array()?
- Stop turning small dashes into longer ones
- what function can I use to automatically output og tags per page/post?
- How to get specified parent page title in my function
- Execute function after a post has been published
- Last updated date function
- Add error message on password protected page ONLY when password introduced was incorrect
- Select pages by category
- wp_register_script(… $in_footer = true) not working
- I want to get product attirbute in the section below
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Restore Image Title Text
- Load Woocommerce and WordPress Functions Outside
- Output and filter data from a XML url
- Where to start learning more about wordpress templates [closed]
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- How do I create a function that simulate the click on Update button for all posts?
- Parse error after modifying the template menu [closed]
- Reuse variable in hook callback
- Multisite Ajax serialize return error [object Object]
- Full page template function
- Redirect from “private” page and functions.php which tag add to add_action()?
- PHP mixed with some JS code to update WordPress theme settings