Extra <h2> tag in sidebar calendar (5 posts)

  1. wonderfulunion
    Posted 8 years ago #

    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">

  2. gilliancs
    Posted 8 years ago #

    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.

  3. wonderfulunion
    Posted 8 years ago #

    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.


  4. zuperzed
    Posted 7 years ago #

    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 :(

  5. zuperzed
    Posted 7 years ago #

    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 :)

Topic Closed

This topic has been closed to new replies.

About this Topic