• Resolved vinchoz

    (@vinchoz)


    Hi,

    Already thnak’s for your article and for your plugin … so easy to use!!
    I’m trying to customize the content of the modal (adding title or thumbnail)…

    I copy the function in my functions.php:

    /**
     * Wrap content
     *
     * @return string
     *
     * @since   1.0.0
     */
    add_action('the_content', 'wrap_content');
    function wrap_content($content)
    {
        return '<div id="modal-ready">' . $content . '</div>';
    }

    … i can override with custom html: great!!!

    but i would like to add the title and thumbnail… try to add “the_title();” but no way

    Any easy idea?

    Thank’s again

    Best

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author allurewebsolutions

    (@allurewebsolutions)

    Hello, thanks for the kind words.

    There would be three ways to achieve what you’re looking for:

    1) Add the title and thumbnail into the content
    2) Create a custom template and manually wrap all that you need in the modal-ready div
    3) Modify the content hook function to include the title and thumbnail. For example:

    /**
     * Wrap content
     *
     * @return string
     *
     * @since   1.0.0
     */
    add_action('the_content', 'wrap_content');
    function wrap_content($content)
    {
        return '<div id="modal-ready"><h1 class="entry-title">' . the_title() . '</h1>'. '<div class="featured-image>' . the_thumbnail() . '</div>' . $content . '</div>';
    }
    Plugin Author allurewebsolutions

    (@allurewebsolutions)

    Closing due to no further response

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customize the content of the modal’ is closed to new replies.