swatit-jromero / wpng-calendar

Automatically exported from code.google.com/p/wpng-calendar
0 stars 0 forks source link

Duplicate, Empty <h2> Tag Fix #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This plugin, in it's output, drops an additional, empty <h2> tag before
actually printing the title of your widget. The output looks like this:

<h2 class="widgettitle"></h2>   <h2 class="widgettitle">Upcoming Events</h2>

This is a problem for XHTML-addicts as well as people using a horizontal
sidebar, as this output isn't valid and also can disrupt the layout of the
sidebar so that this widget is lower than the rest.

The problem can be fixed by editing the file wpng-calendar.php around line
264. Change this block of code:

echo $before_widget . $before_title . $after_title;

if(!$options = get_option('wpng_cal_widget_options')) { 
    $options = array('wpng_cal_widget_list_size' => 5, 'wpng_cal_widget_title'
=> 'Upcoming Events');
}
?>

<h2 class="widgettitle"><?php echo($options['wpng_cal_widget_title']) ?></h2>

to the following block of code:

if(!$options = get_option('wpng_cal_widget_options')) { 
    $options = array('wpng_cal_widget_list_size' => 5, 'wpng_cal_widget_title'
=> 'Upcoming Events');
}

echo $before_widget . $before_title . $options['wpng_cal_widget_title'] .
$after_title;
?>

I've attached a fixed wpng-calendar.php file with the changes already made.

Hope this keeps someone from tearing their hair out!

Original issue reported on code.google.com by wizz...@gmail.com on 28 Jul 2008 at 5:04

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for this fix. I just started using this plugin and thought the problem 
was
with my theme. So far everything seems to be working fine with your provided 
file.

Original comment by bjsmi...@gmail.com on 19 Aug 2008 at 12:21

GoogleCodeExporter commented 8 years ago
THANK YOU!

Original comment by swing.fl...@gmail.com on 19 Aug 2008 at 2:43

GoogleCodeExporter commented 8 years ago
Great fix and thanks for the .php file.  Hours of searching and hacking...all 
behind
me now. 

Cheers

Original comment by spencerp...@gmail.com on 29 Nov 2008 at 1:55

GoogleCodeExporter commented 8 years ago
Thank you just what I needed!

Original comment by aong...@gmail.com on 20 Jan 2009 at 11:20

GoogleCodeExporter commented 8 years ago
This certainly solved the dual H2 issue but the alignment of the sidebar items 
(CSS)
is still screwed-up.  :(

Original comment by ksh...@kellysoftware.com on 12 Feb 2009 at 4:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I didn't know what my problem was but the title was appearing below my title 
box. 
And this code did the trick - thank you!!!

Original comment by anshe.ch...@gmail.com on 18 Dec 2009 at 5:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
BEAUTIFUL! THANKYOU VERY MUCH!!!!!!

Original comment by RideSche...@gmail.com on 31 Oct 2010 at 10:24

GoogleCodeExporter commented 8 years ago
<h2 class="widgettitle"> should be changed to <h3 class="widget-title">

That will fix most of the theming issues... at least as far as I have been 
dealing with it. 

Original comment by vlo...@gmail.com on 1 Dec 2010 at 4:00