• 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:
    https://mn8studio.com/blog/

    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
    &nbsp;
    is the code for a space, so you need to delete the whole:
    <h2>&nbsp;</h2>

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

    Thread Starter wonderfulunion

    (@wonderfulunion)

    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.

    thanks.
    demetre

    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) {
    	extract($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">';
    	get_calendar();
    	echo '</div>';
    	echo $after_widget;
    }

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

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

    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.