One easy way to do this is to alter the global variables related to paging after calling the_post()
in your loop.
global $post, $pages, $numpages, $multipage;
while( have_posts() ) {
the_post();
if( is_mobile() ) {
$pages = array( $post->post_content );
$page = $numpages = 1;
$multipage = false;
}
// ... template
the_content();
}
Basically what you’re doing is un-doing the paging setup done in setup_postdata()
Related Posts:
- paginate_links() don’t properly work in search.php?
- How to paginate the get_users function?
- Pagination adding page-numbers dots when using ‘mid_size’ => 0
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- How to style current page number (wp_link_pages)?
- Customize “the_posts_pagination” and put list instead div
- Find first image on paginated post for Pinterest
- Post Pagination Showing Same Posts Every Page
- Generating rel=prev and rel=next only on wordpress categories
- Shortcode pagination not advancing
- get_next_posts_link not working without parameter max_num_pages
- Pagination in relation to archive.php
- paginate_links() don’t properly work in search.php?
- the_posts_pagination() function returns missing page numbering on some blog pages
- Custom Query Not Paginating
- Where to call my pagination function?
- Remove ‘page-numbers’ class from prev and next tags
- Modifying the_posts_pagination from within functions.php instead of template files
- Unable to Change “Pages:” Before WP_LINK_PAGES
- How do I make a custom “Read More Blogs” button for my blog page
- I want to customize the_posts_navigation function by replacing prev and next with images
- Shortcode with pagination advancing multiple queries
- Pagination won’t work on custom page
- Pagination not working on my archive page for a custom post type
- Display page number on custom page title function
- Need some Tweak my nextpage Function
- WordPress not showing pagination links
- Pagination in Search result
- Adding pagination to custom WordPress function
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- Insert image between X number of posts but on specific paginated pages?
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Issue with wp_get_attachment_image() and SVG file type
- deregister scripts on certain page
- Pagination custom query
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Formatting post content to exclude gallery
- Why do I get undefined function export_wp()?
- How to remove the embed_footer?
- Hide some items from Screen options in dashboard for products
- Function to show only first instance of shortcode
- Using the child theme functions.php to change the customizer.php on parent theme
- Can’t Update function.php after writing short code
- How to get last updated row or ID in wordpress
- 2 Loops, Only Displaying 1 Loop in Both Loops
- edit role display name and label name without plugins
- Two functions.php files in one theme
- wp_dropdown_categories and custom attribute
- Converting html to wordpress images not showing
- How can I add text to all posts/pages/categories/homepage etc
- Pulling Twitter RSS feed not working as expected (fatal error)
- Related post using post title
- Move Post to different category if post_meta field is 0 or is 2 days old?
- Find a Javascript ID when trying to deregister?
- Functions For Calling Specific Elements
- Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Condition OR for current user ID
- wp_create_category deprecated?
- If user is logged-in display/hide something
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- WordPress Excerpt – How to remove the first link using functions.php
- Sortable column (by numbers) in admin users
- How can I add a class to a nav li depending on URL?
- Access category within rss2_head hook?
- load CSS only for administrators on backend
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- Prevent WordPress Automatic Logout
- Insert Address fields into function
- functions php file [closed]
- How to remove admin footer text from inside child theme?
- Problem with images URL after filter applying
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- Modify function to only return values for the user that’s logged in
- WordPress performance – send all metaboxes to function or to call it again
- Custom attributes to javascript tags
- How to add php within jquery
- Is it possible to put a function somewhere other than the functions.php file?
- wp_enqueue_script() not working
- Display a list of random terms from custom taxonomy with shortcode
- Overwrite text in a complicated filter hook
- WP_Query for Attachments not working as expected
- Text replace for the whole body tag
- Link product attribute value to a URL – woocommerce
- Deleting guests profile users after 1.5 hours
- Trying to get the path to my child-theme via my functions.php
- Remove action hook from Class, understanding OOP
- Create custom admin bar menu items
- Adding a class to the body of an inactive site using multisite
- Redirect logged user depending on user role if he tries to access home page?
- Placing CSS/ JS into the header or footer (inline) – trying to apply to several templates
- How to automatically add custom classes to headings in content area
- How to display content If function exist/condition true?
- Regex works in regexr, but not if I filter content [closed]
- Adding a filter with custom function to the menu / navigation
- Increase Comment Author Gravatar Size On WordPress Default Comment Function
- theme options not saving
- Give a function a unique ID
- Different ads on every website on multisite environment
- How to get variable from other function inside class function using add_action for Ajax call