WordPress.org

Ready to get started?Download WordPress

Forums

Changing footer call (2 posts)

  1. BBustamante
    Member
    Posted 1 year ago #

    Hi, I'm triying to chang the footer text by a plugin, I can add the new text, but the old one still apears. Can any body help me, pleas. Here is the code:

    <?php
    // AÑADIR FIRMA AL FINAL DE LA WEB
    function custom_footer_text()
    {
    $content = '</div><!-- #main .wrapper -->';
    $content .= '<footer id="colophon" role="contentinfo">';
    $content .= '<div class="site-info">';
    $content .= '<?php do_action( "twentytwelve_credits" ); ?>';
    $content .= 'Desarrollado por Beñat Bustamante bajo WordPress';
    $content .= '</div><!-- .site-info -->';
    $content .= '</footer><!-- #colophon -->';
    $content .= '</div><!-- #page -->';

    $content .= '<?php wp_footer(); ?>';
    $content .= '</body>';
    $content .= '</html>';
    echo $content;
    }
    add_action( 'get_footer', 'custom_footer_text' );
    remove_action( 'wp_footer', 'get_footer' );
    ?>

  2. bcworkz
    Member
    Posted 1 year ago #

    If the footer content is generated by the theme's footer.php template, you would need to alter the $name parameter passed to your 'get_footer' callback as well as add a footer template file to the theme folder called "footer-{$name}.php"

    If the content was indeed added through 'wp_footer' action, be sure to remove the hook using the same priority it was added with.

Topic Closed

This topic has been closed to new replies.

About this Topic