• Resolved lars2923

    (@lars2923)


    I notice helpful is displayed on every page of a multi-page article. Is there a setting to allow helpful to be displayed only on the last page?

    For example: Imagine reading a book and at the bottom of each page is: Did you like this book?

    I would like to place the question at the end of the article, not on each page of a multi-page article.

    Is this doable? If Yes, How? If No, may we get this feature added?

Viewing 1 replies (of 1 total)
  • Plugin Author Pixelbart

    (@pixelbart)

    @lars2923

    That’s a good idea that I hadn’t considered. I’ll put that on my todo list to make it an option.

    In order for you to use Helpful in the meantime, you first need to go to Helpful > Settings > Details > General and set that to no longer automatically output Helpful in the content.

    After that you can use the following code:

    functions.php:

    
    add_filter('the_content', function ($content) {
        global $wp_query, $page, $numpages, $multipage, $more;
    
        if (!is_single()) {
            return $content;
        }
    
        $shortcode = do_shortcode('[helpful post_id="' . get_the_ID() . '"]');
    
        if ($multipage) {
            if ($page === $numpages) {
                return $content . $shortcode;
            }
    
            return $content;
        }
    
        return $content . $shortcode;
    });
    
Viewing 1 replies (of 1 total)
  • The topic ‘Displayed on every page of a multi page’ is closed to new replies.