Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Sergio De Falco

    (@sgr33n)

    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!

    Plugin Author Sergio De Falco

    (@sgr33n)

    Doesn’t take too much.

    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!

    Plugin Author Sergio De Falco

    (@sgr33n)

    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!

    Plugin Author Sergio De Falco

    (@sgr33n)

    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/

    Thread Starter maryb1

    (@maryb1)

    OK, thank you.

    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 4 years, 5 months ago by TiKu.
    Plugin Author Sergio De Falco

    (@sgr33n)

    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.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘TOC position’ is closed to new replies.