is_paged

Home » Functions » is_paged

Function Name: is_paged

Explanation: The is_paged function in WordPress is used to check if the current page being displayed is a paginated page. Paginated pages are typically used when displaying a list of posts or custom post types where the content is divided into multiple pages.

This function returns a boolean value, true if the current page is a paginated page and false otherwise. It is commonly used within WordPress templates to conditionally display certain content or apply specific styling for paginated pages.

Example Usage:

if (is_paged()) {
   // Display additional content or apply specific styling for paginated pages
   echo '<div class="pagination">Page ' . get_query_var('paged') . '</div>';
} else {
   // Display default content for non-paginated pages
   echo 'Welcome to our blog!';
}

In the example above, the is_paged function is used to determine whether the current page is a paginated page. If it returns true, an additional div with pagination information is displayed. If it returns false, a default welcome message is displayed.

Note: The is_paged function is typically used within the main WordPress loop to check if a paginated page is being displayed.

Learn More on WordPress.org

WordPress snippets using the is_paged function

Register an account to save your snippets or go Pro to get more features.