The way I understand this, you’re trying to filter wp_title
to include your pagination data.
You can change the format in the sprintf
first parameter and other params as per your needs. Please use with caution.
add_filter('wp_title', function( $title ) {
global $paged // page number
, $wp_query; // WordPress query data
if( ! is_feed() && (int) $wp_query->max_num_pages > 1 ) {
$title = sprintf(
"%s - %d/%d - %s", // format
get_bloginfo('name'), // blog name
(int) $paged > 0 ? $paged : 1, // current page (goes 0 if no param set)
$wp_query->max_num_pages, // max number of pages found
get_bloginfo('description') // blog description
);
}
return $title;
}, 999);
Hope that helps.
Related Posts:
- Paging on a future post loop?
- How to deal with equal & similar arguments for a function?
- Problem with parameters in url and pagination
- pagination in a custom list created with get_pages function
- Pagination not working with custom wp_query
- How to get the number of pages when paginating comments?
- How to implement pagination into a wpdb->result query?
- post_results filter confused by pagination in sidebar and main section
- Where to store PHP files created by plugin / themes
- How to debug a plugin with Xdebug?
- WordPress 4.5 deprecated get_currentuserinfo()
- Single Responsibility Principle and WP Classes
- How to control output of custom post type without modifying theme?
- Admin config screen without menu
- What is the added “complexity” of custom tables?
- How to Structure a New Role/Capability Scheme?
- How to create Image gallery Metabox in wordpress [closed]
- Is it possible to create an action hook using do_action() within add_action()?
- How to exclude content (and other returned values) from WP_query()?
- Why does preg_replace_callback never fire in this function?
- WordPress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?
- Need specific kind of “Poll Voting” for WordPress [closed]
- WordPress select dropdown list in widget
- Call to undefined function get_blog_option()
- Unable to get content from $post on first publish
- Plugin admin page meta_box toggle and order state not saving
- Broken markup when using the_excerpt() in a widget?
- Best Practices for Creating and Handling Forms with Plugins?
- Is there a better way to implement responsive images than what WordPress uses by default?
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- How can I add a CSS rule to edit.php?
- How do you render_callback for register_block_type to a method in another class?
- Get the password key when using the wp_new_user_notification_email filter
- WordPress API have Plugin Anti-piracy feature?
- Use WP_Theme::scandir function to scan a plugin directory. Is there a way?
- Plugin options not being saved or created
- Customizer: widget-synced triggers twice
- Plugin Repo: Why do some plugins get version charts while others don’t?
- maintaing consistent layout wordpress dashboard
- Change the ‘published on’ text?
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- user_register not triggering with email verification
- How to get boolean value from register_meta properly?
- Why is the WordPress taxonomy not registering?
- Gravity Forms Perks – Nested Forms
- Checking for existence of a page by title?
- How can I identify it as admin page or not?
- AJAX form post returns 0
- Adding admin menus to wordpress
- Autogenerate a Table of Contents
- Why enqueue styles on hook?
- Fatal error: Cannot redeclare admin_notice() [closed]
- Update wordpress Core Remotely
- Proper way to use useSelect
- Access to apache logs from plugin
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Translating plugin settings page – dropdown list
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- how to save wp_editor html content in options table
- Hide one specific woocoomerce product
- Plugin Form Submitting to admin-ajax.php instead of admin-post.php
- Unable to access custom plugin backend
- Resize not resizing images with Capitial extension like JPG
- Redirect returning users to a certain page?
- wp_schedule_single_event is set correctly but sometimes not fired
- WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
- Attaching Image-file to userId
- wp.media gallery collection sometimes undefined
- Can’t load a script in my plugin page
- Add New Button in Admin Panel
- ajax call return 406 not acceptable for non logged users only
- $ is not defined [duplicate]
- Counter not working correctly
- Inserted data from database does not showing on front-page without referesh page?
- Remove tag from all posts when publishing new post
- wp_editor embed shortcode not working within my plugin
- How To do Ajax In WordPress Custom Plugin?
- replacing jquery google cdn with a new version dynamically
- Dynamically getting tags in post edit screen
- WordPress mails being sent from @locahost and being rejected
- wordpress plugin require_once file – can’t user wordpress functions
- Acessing WP functions in form submission handler
- Custom theme and plugin updating
- Dynamic banner for use on external sites
- What method should I use to store my plugin data (multi level menus with options on each item)
- problem with blank page
- Error on using __FILE__ for add_menu_page() Function
- Getting error of unexpected output during activation
- Use custom clean URLs for a plug in
- An adiitional function fires on my AJAX submit
- Projectmanager Internal Link Code Location
- Select options not reloading after form submit
- How to add something after a function
- Plugin SVN folder structure
- how many rupee or dollar charge to client to make theme [closed]
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies