WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] divs included in "functions.php" appearing in wrong place (3 posts)

  1. jzahlaway
    Member
    Posted 3 years ago #

    I have the following in my functions.php file:

    echo '<div id="home-slider">' . wp_content_slider() . '</div>';

    After loading the page in a browser and viewing the source code, the opening and closing div tags appear side by side *after* the code generated by wp_content_slider(). (eg: <[wp_content_slider code]><div id="home-slider"></div> I can't for the life of me figure out why on earth this is happening, nor how to fix it. Anyone?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    wp_content_slider() is outputting the slider directly, not into a string as your code would need;

    try:

    echo '<div id="home-slider">'; wp_content_slider(); echo '</div>';

  3. jzahlaway
    Member
    Posted 3 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic