The $multipage
is constructed inside the setup_postdata()
method of WP_Query
.
It’s called when you run the_post()
. So just as @s_ha_dum explained, you have to make a loop around it:
You can try this:
if( have_posts() )
{
the_post(); // Make a call to setup_postdata().
echo sbwp_get_current_chapter(); // Display the current chapter.
rewind_posts(); // Rewind back.
}
before your main loop, where you must remember to rewind back.
Related Posts:
- How to style current page number (wp_link_pages)?
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Unable to Change “Pages:” Before WP_LINK_PAGES
- Ajax call always returns 0
- plugins_url vs plugin_dir_url
- Where and how to put inline js in pages
- Is it possible to remove the “standard” post format?
- Hourly Routine Not Firing ( wp_schedule_event() )
- Warning/Notice about functions.php
- Is checking whether the blog is installed necessary?
- echo or print_r in an admin function
- Overriding methods in a child theme
- Updating users_can_register option?
- How to add an anonymous function in wordpress hooks by removing create_function
- Changing post category from dropdown
- How to update feed only 2-3 times a week (for Feedburner email)?
- Fatal error when trying to get admin email on contact form
- Is it good practice to use wpdb->query() function?
- img width and height attributes being set by get_the_post_thumbnail
- How to properly add NPM packages and integrate them in WordPress?
- wp_enqueue_script add integrity parameter
- change in form-checkout.php by using code in functions.php
- List child pages of specific page using shortcode
- Custom function in My Custom Functions returning 403
- Register vendor JS/CSS only on pages that require them?
- Adding HTML to the end of every post with the Block Editor
- Can I hide certain upload folders in media library [duplicate]
- Remove H1 / title / Underscore – without CSS
- Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function now working
- functions.php How to add css/js depending on Template Name?
- wp_nav_menu, walker class, categories as classes of li
- Wp_query function to search from product_title ‘OR’ product tags name
- Why is my page feed returning empty content?
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- Including a specific Javascript Script in a template. Is my code correct?
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Adding a colorbutton in tinymce dialog with current api
- Accessing two databases wordpress
- Add a jQuery Function
- append to existing parent theme function
- Get category URL for current post
- How can I get the post id from within functions.php
- Check if Page Slug Exists, then display that Page’s Title
- How to get correct value from checked()?
- I have problems with loading javascripts
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Redefine function arguments before rendering
- How do I change a parent theme’s function through the child theme?
- Enqueue script on every page except one
- Best way to handle lack of titles in microblogging
- Dropline menus — seperators between children only?
- Echoing function into WordPress NextGen gallery
- does wp function the_content(); accept another tag inside
- How to parse a shortcode within a shortcode?
- Redirect to other page if login
- first paragraph of the_content as meta description
- get_terms (or tax_query) for term of current post?
- 404 when enqueue_script using plugin_url
- WP Customizer API loaded into functions.php
- Get term slug by term id and then explode it
- Shortcode question
- call_user_func_array() expects parameter 1 to be a valid callback, function
- How to use get_posts() function in functions.php
- the_widget() inside functions.php
- How Can I add a menu to the theme from withen the function.php file
- define css class in functions.php
- Adding tables to the WordPress Editor
- Add Login and logout buttons to top menu bar
- implementing a centralized content “show-do-not-show” toggle?
- WordPress – using sessions?
- Trigger email alert if file downloaded
- Completely Disable WordPress RSS Feeds
- How to hide content on mobile in the functions.php file – woocommerce
- Load templates, pass arguments, and render output from functions.php
- WordPress Lite/Light
- How to add HTML into error message
- Selecting specific query for offset
- Is_Page doesnt detect my page
- Security when outputing wp_oembed_get code
- Show image after X para – center aligned
- Problems adding a new field to product in cart
- Function for Sticky Post on Categories causes issues with 404 behavior
- function replace_text for entire page
- Get value of pre-populated Gravity forms field as variable in my function
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- What to do to have access to WordPress functions
- Pass max posts to Javascript
- Changing the color of post title [closed]
- Create html from function
- WP supersize not displaying when different languages flags are selected
- wp_list_pages change of children and anchor of parent
- Admin Panel errors because of functions.php
- WordPress not performing direct update
- Using Output from one Function and calling it into another
- How to add a class and title attribute to the link generated by next/previous post
- “Headers already sent” while trying to add a CSS file to my login page?
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- Problem with removing characters “<” – WpAllImport
- Using input_attrs() Multiple Times Within One Customizer Control