[resolved] Alter Meta Widget in Sidebar (5 posts)

  1. whataboutki
    Posted 8 years ago #

    Hello, I am wanting to remove some of the links that are in the meta widget. It has 5 links now:

    Entries RSS
    Comments RSS

    Is there a way for me to only have the first 2 links Register and Login?

    Where is the code for the widgets kept? If I find that I'm sure I can play around enough to figure it out myself.

    Thanks in advance for your help.

  2. I would just use a Text widget instead, and make your own links in it. Simpler, easier to change later, doesn't break when you upgrade.

  3. whataboutki
    Posted 8 years ago #

    Yeah that would be easy.... but then it would always say login even if you were already logged in?

  4. pedmands
    Posted 8 years ago #

    You could also use:

    <li><h2><?php _e(’Meta’); ?></h2>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <?php wp_meta(); ?>

    Those are dynamic functions- in other words it'll say "register/site admin" and "log in/log out" depending on whether you're logged in or out.

    Haven't tried php functions in a text widget, but what better time to try than now? If that doesn't work, you can always search for a meta-widget in the plugins here, and then open it up and tinker in the .php file.

    The code for the widgets are in wp-includes/widgets.php

    But I wouldn't mess with that unless you really know what you're doing.

  5. whataboutki
    Posted 8 years ago #

    Thats perfect thanks.... php doesn't work in txt widgets but there are some php widgets that I am already using! Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic