WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar widgets - how do I remove title bar/header (19 posts)

  1. jguttman
    Member
    Posted 6 years ago #

    I'm trying to remove the title bar/header in several sidebar widgets. Is there any code I can put in the title field to remove the title bar/header altogether? Also, is there a way to remove/control the dotted lines that separate sidebar widgets?

  2. Alex Cragg
    Member
    Posted 6 years ago #

    open up the widget's php file and look for this line
    $before_title . $title . $after_title for the relevant widget. edit it out or delete it. that will remove the code that opens the title, puts the title in and closes the title code. your other issue is probably css based, and will vary on your theme.

  3. jguttman
    Member
    Posted 6 years ago #

    Thanks!! Both issues are sidebar widgets. Where can I edit its php file?

  4. Alex Cragg
    Member
    Posted 6 years ago #

    what i mean is, the dotted lines have probably been added in using css, as they aren't a default function. If you give us a link to your site if its live i could tell you better what to change.

  5. jguttman
    Member
    Posted 6 years ago #

  6. Alex Cragg
    Member
    Posted 6 years ago #

    ok, you have this in your css file, which is probably style.css:

    #content h2
    border-bottom:1px dotted #C0C0C0;
    border-top:1px dotted #C0C0C0;

    that is what is creating your dotted lines. if you delete both of those lines(not #content h2) then the dotted lines will go away wherever you use a h2 title.

    did you delete the lines that i said about before? I take it that it is for your google search box that you wanted to remove your title, as its the only one that is blank?
    For your google search box, on your plugins list, look for google search widget, and click on edit on the right. then remove . $before_title . $title . $after_title - you'll find it about half way down.

  7. jguttman
    Member
    Posted 6 years ago #

    thanks for the tip on the google search bar. the main issue is bottom left sidebar. i want to remove the title above the "click" graphic (just a filler image for now). i dont want to remove all titles/headers on the page. isn't h2 used elewhere as well?

  8. Alex Cragg
    Member
    Posted 6 years ago #

    ok, i missed that one. so this one by the click image is a standard text widget. so this time, go to your plugins list, then on sidebar widgets, click edit on the right. find this section `function widget_text($args, $number = 1) {
    extract($args);
    $options = get_option('widget_text');
    $title = $options[$number]['title'];
    if ( empty($title) )
    $title = ' ';
    $text = $options[$number]['text'];
    ?>
    <?php echo $before_widget; ?>
    <?php $title ? print($before_title . $title . $after_title) : null; ?> <--- here
    <div class="textwidget"><?php echo $text; ?></div>
    <?php echo $after_widget; ?>and delete or comment out the php bit ive indicated - so the$title ? print` etc bit. The only problem with this is that for every text widget you have, you wont get a title. This is an issue that has been raised before, and it should be resolved in the next widget release. hope thats all clear? as for your h2s, add this to your css h2.widgettitle {
    color:#000000;
    font-family:Times New Roman,Verdana,Arial,Sans-Serif;
    font-size:14px;
    font-weight:bold;
    margin:0px;
    padding:5px 0px; } this should differentiate between a normal h2 and a widget h2, and it now doesnt have the dots.

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    A better way than hacking the code would be to use some CSS to do it.

    Example: If you wanted to get rid of the "Recent Posts" title header thing, then this would do it:

    .widget_recent_entries .widgettitle {
    display: none;
    }

    Or say the just empty space above that big click button on the lower left side:

    #l_sidebarwidgeted .widget_text .widgettitle {
    display: none;
    }

    Just add to your theme's stylesheet and go with it.

  10. jguttman
    Member
    Posted 6 years ago #

    Shit - I'm getting a syntax error now (line 835). i can't even undo, still showing syntax error. i may be in over my head. here is the paragraph. do you remind editing and posting for me.

    <?php echo $before_widget; ?>
    <?php $title ? print($before_title . $title . $after_title) : null; ?>
    <div class="textwidget"><?php echo $text; ?></div>
    <?php echo $after_widget; ?>

  11. jguttman
    Member
    Posted 6 years ago #

    dude - are you on IM - I'm in trouble here, sinking fast.

  12. jguttman
    Member
    Posted 6 years ago #

    getting a syntax error and getting locked out of my site. help!! what do i do now?

  13. Alex Cragg
    Member
    Posted 6 years ago #

    do you have ftp access to your site? you need to use that.

  14. Doodlebee
    Member
    Posted 6 years ago #

    Otto definitely had a good solution up there - no need to hack code - just edit your CSS file.

  15. jguttman
    Member
    Posted 6 years ago #

    Otto - you rock!! Thanks dude.

  16. jguttman
    Member
    Posted 6 years ago #

    Epicalex - I appreciate your time as well....though the css route was much easier.

  17. Alex Cragg
    Member
    Posted 6 years ago #

    haha, yeah, it sure was!

  18. js09
    Member
    Posted 6 years ago #

    .widget_recent_entries .widgettitle {
    display: none;
    }
    i replaced 'recent_entries' with 'links' it works great!

    however i have more than 2 link sets, each with there own title area. what CSS could i use to only removes the widget title for a specific link set?

    thanks

  19. aptdesignonline
    Member
    Posted 6 years ago #

    Wow. Great fix Otto. That helps a ton.

Topic Closed

This topic has been closed to new replies.

About this Topic