WordPress.org

Support

Support » How-To and Troubleshooting » Inserting code just before <?php comments_template();? >?

Inserting code just before <?php comments_template();? >?

  • I’m working on a plugin and was wondering how I could insert code into wordpress (such as html, php, etc, etc) just before <?php comments_template(); ?> is called by the theme?

Viewing 5 replies - 1 through 5 (of 5 total)
  • bump??

    You’re not being very helpful in describing what you want to do exactly…

    Hi i'm some text before the comments template...?
    <?php comments_template(); ?>
    <p>Hi i'm some text in a paragraph tag before the comments template function.</p>
    <?php comments_template(); ?>

    ?

    Hi t31os,

    At its core I want to do this:

    <?php include=’someurl’; ?>
    <?php comments_template(); ?>

    So basically call <?php include=’sumeurl’; ?> before <?php comments_template(); ?> but do it via a plugin rather than manually inserting it into every theme.

    Still no ideas?

    I’ve not written plugins myself, i always use theme functions. I wouldn’t be able to advise on how to correctly and safely hook into themes via a plugin.

    If you get a nice straight-forward answer to the question i’ll be interested to see it to.

    Of course the easy way would be to find a basic plugin (something with a few lines of code only), rip the code from it and modify as needed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Inserting code just before <?php comments_template();? >?’ is closed to new replies.
Skip to toolbar