• Hi people,

    i researched quite a bit but couldnt find an answer for this :

    I want to replace the comment template of the theme (comments.php or whichever it is using) totally with my own function or comments.php in plugin.

    In short, i want to totally override the theme’s entire commenting template.

    I was able to find this recommendation in stack exchange for this :

    add_filter( “comments_template”, “my_custom_function”,0 );

    However, this just filters the function, and my function just runs before comments_template, leading comments_template to STILL run after itself and load up the commenting template from the theme.

    What should i use to accomplish this ?

Viewing 1 replies (of 1 total)
  • Thread Starter unity100

    (@unity100)

    Never mind i found it by examining other plugins :

    After overriding it with

    add_filter( “comments_template”, “my_custom_function”,0 );

    your function must return a comments.php from whever yo pick :

    return dirname(__FILE__) . ‘/comments.php’;

    this overrides comments totally.

Viewing 1 replies (of 1 total)

The topic ‘Replacing/Overriding comments_template() from plugin’ is closed to new replies.