Hi,
I could add a filter to make it possible.
Thread Starter
maryb1
(@maryb1)
That would be great! Of course, my next question is: do you have an idea of when this could be implemented?
Thanks!
Thread Starter
maryb1
(@maryb1)
Great, I’ll wait then. Thanks!
Thread Starter
maryb1
(@maryb1)
I’ve been thinking about this some more, and I’m thinking it would be best to be placed right above the first subpage title, as opposed to right below the main page title because sites often have other elements right below the main page title (image, other paragraph or sometimes even breadcrumbs). Just a thought!
Done, you can customize as you want using the following filter:
/*
* Filters the multipage post content.
*
* @since 1.5.4
*
* @param string $output The enhanced content.
* @param string $page_title The subpage title.
* @param array $toc_labels The table of contents html.
* @param array $content The original content.
*/
$output = apply_filters( 'mpp_the_content', $output, $page_title, $toc, $content );
Thread Starter
maryb1
(@maryb1)
Hello, that’s great, however, I’m not advanced enough to know what to do with this:
– Where to insert it?
– How to customize it?
I do see this filter in the class-mpp.php file. Is that where I have to customize it?
Thanks!
Sorry, then I think you should ask a developer to use it. Thanks to this filter you can create your own simple plugin to customize how multipage posts appear. I think you could learn more on filters here: https://www.wpbeginner.com/glossary/filter/
Thanks a lot for this filter. It allowed me to remove some customizations of your code. But could it be that it does not allow having the TOC before the post’s featured image? It seems like $output does not contain the featured image when this filter is called.
For this reason I’m still using the single_post_start action. Currently I’m investigating whether I could at least move this action out of your plugin into my theme.
-
This reply was modified 5 years, 11 months ago by
TiKu.
Good.
This doesn’t include the featured image due to template limitation.
Okay. I managed to move my customizations in this area into my theme, by using the single_post_start action.