WordPress.org

Forums

Add a widget bar to comments_template.php (4 posts)

  1. tropicaltidbits
    Member
    Posted 1 year ago #

    Hello,

    I'm trying to add a custom widget bar to my comment_template.php file, placed next to the textarea html tag. The relevant section of the file is here:

    http://pastebin.com/DwQVEyWz

    The line of code used to call my widget bar in a standard index.php file is this:

    <div id="widgets2"><?php dynamic_sidebar( 'widgets2' ); ?></div>

    However, since the part of the comments_template.php file that creates the comment textarea section of the html is part of a PHP array, I can't use php tags to call the function the way I usually would. Given my limited PHP experience, I need to know the correct syntax to integrate the sidebar into the template file, ideally immediately preceding the "textarea" html tag near the top of the code block above. Any help would be appreciated.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Why are you editing a core WordPress file?

  3. tropicaltidbits
    Member
    Posted 1 year ago #

    Because somehow I need this widget bar to float to the right of the comment textarea wherever it goes, but there is no other element with which to accomplish that task except the textarea html tag itself. This is the file where that tag is generated, and therefore the file I want to edit to accomplish this.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Never, ever, edit core WordPress files. You can control the comment form via your theme's template files & CSS.

Topic Closed

This topic has been closed to new replies.

About this Topic