Support » Themes and Templates » Extra <h2> tag in sidebar calendar

  • Hello,
    I have a problem when I insert a calendar into my sidebar using the “presentations/widgets” section of my admin where it’s inserting an unnecessary <h2></h2> tags prior to the calendar heading and it throwing off things in my sidebar.

    Does anyone know where I can find the code in my wp files to remove that extraneous <h2> tag?

    You can seee it here on the left:

    Right above the word “October 2007”

    Here is what’s displaying in the html
    <h2>&nbsp;</h2><div id="calendar_wrap"><table id="wp-calendar" summary="Calendar">

Viewing 4 replies - 1 through 4 (of 4 total)
  • You probably know that
    is the code for a space, so you need to delete the whole:

    I don’t know how the widgets are included from the admin panel.

    yes i know this. does anyone know what file/line i can find the markup for this widget. i have looked and cannot track it down.


    Did you ever find a solution for this?

    I have the exact same problem, like this:
    <h4 class="widgettitle">&nbsp;</h4>

    Is this WordPress error or My Custom Theme error?

    EDIT: I looked at your website and guess I just have to live with it like you do 🙁

    I contacted the author of the theme I’m using and got an answer to this so I thought I’d post it here for others facing the same “problem”.

    The title of the calendar widget is in the table’s caption tag.
    Instead of naming the widget “Calendar” he’d rather have the month name as the widget title, so he put a blank in place of the widget title.

    Like this (located in \wp-includes\widgets.php):

    function wp_widget_calendar($args) {
    	$options = get_option('widget_calendar');
    	$title = apply_filters('widget_title', $options['title']);
    	if ( empty($title) )
    		$title = '&nbsp;';
    	echo $before_widget . $before_title . $title . $after_title;
    	echo '<div id="calendar_wrap">';
    	echo '</div>';
    	echo $after_widget;

    And this is how it looks like in \My_Theme\widgets.php:

    <<?php echo $tag_widget_title; ?> class="widgettitle">&nbsp;</<?php echo $tag_widget_title; ?>>
    <?php get_calendar(); ?>

    That’s it 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra <h2> tag in sidebar calendar’ is closed to new replies.