WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] <?php wp_register(); ?> (6 posts)

  1. Dragen
    Member
    Posted 7 years ago #

    Hi,
    I'm trying to design my own template, but have ran into a small problem.
    I'm trying to use the
    <?php wp_register(); ?>
    code in my footer. The problem is that for some reason it places it within
    <li></li>
    tags. This is a bit of a pain.. can I change this?
    I've only just started with wordpress about two minutes ago, so I'm not sure which files to edit to change this kind of stuff yet.

    Thanks,
    Lee

  2. Dragen
    Member
    Posted 7 years ago #

    Ok, I've just solved it :P
    open up wp-includes/general-template.php
    then find
    function wp_register( $before = '<li>', $after = '</li>' ) {
    Simply edit the $before and $after parts.

  3. Chris_K
    Member
    Posted 7 years ago #

    You will definitely hate yourself after your next WP Upgrade (that change will be gone....).

    As a rule of thumb, don't edit core files. Edit theme files instead (wp-content/themes/YourThemeName).

    Check out the documentation on wp_register.

  4. Dragen
    Member
    Posted 7 years ago #

    oh, okay. thanks.
    So if I want it displayed without
    <li></li>
    then I need to put <?php wp_register('', ''); ?> where I want it?

  5. Chris_K
    Member
    Posted 7 years ago #

    That's my interpretation, yep. :-)

  6. Dragen
    Member
    Posted 7 years ago #

    yeah, thanks again!
    worked great.

Topic Closed

This topic has been closed to new replies.

About this Topic