• 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Why are you editing a core WordPress file?

    Thread Starter tropicaltidbits

    (@tropicaltidbits)

    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.

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

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add a widget bar to comments_template.php’ is closed to new replies.