0

以下在 footer.php 中给出的示例代码:

<footer id="test" role="role">

    <div id="test-generator" class="clearfix">
        <?php do_action( 'test_open' ); ?>

        <div class="copyright">
            blabla
        </div>

        <div class="powered">
            blabla
        </div>

        <?php do_action( 'test_close' ); ?>
    </div>

</footer>
</div>

<?php wp_footer(); ?>

footer.php 是 wordpress 主题的一部分。我想在 div.class 版权中的“blabla”之后添加一些行。这应该在不修改footer.php 的情况下完成。有什么办法吗?

感谢您的帮助!

4

1 回答 1

1

您需要编写一个与“test_close”操作挂钩的函数,并将其包含在您的functions.php自定义函数插件中:

add_action( 'test_close', 'my_function' );
function my_function(){
    echo "<br/>This is on the next line";
}
于 2013-03-19T02:25:51.607 回答