Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

[SOLVED] html validation error with sidebar used twice on page


  #1  
Old Oct 10, 2012, 01:23 AM
jerryc
 
367 posts · Oct 2012
Florida
If I use the same sidebar twice on the same page (which I'm doing), I get an html validation error because Montezuma is giving the same id name to both <aside> tags. The html validator says:

Quote:
Error: Duplicate ID
  #2  
Old Oct 10, 2012, 05:41 AM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What slider is it
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 10, 2012, 06:39 AM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by juggledad
What sidebar is it
(I'm guessing this is your question.)
<?php dynamic_sidebar( 'image-gallery' ); ?>

It's producing this line of code each time I put that widget on a page:

Code:
<aside id="execphp-2" class="widget widget_execphp cf">
The obvious hack is to make a different sidebar with a duplicate widget in it, but maybe there's a better way.

Thanks.
  #4  
Old Oct 10, 2012, 09:52 AM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you are creating two widget areas you need to name them differently. You should use
HTML Code:
<?php dynamic_sidebar( 'image-gallery-0' ); ?>
and
HTML Code:
<?php dynamic_sidebar( 'image-gallery-1' ); ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Oct 10, 2012 at 03:20 PM.
  #5  
Old Oct 10, 2012, 12:39 PM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by juggledad
If you are creating two widget areas you need to name them differently. You should use
HTML Code:
<?php dynamic_sidebar( 'image-gallery-0' ); ?>
and
HTML Code:
<?php dynamic_sidebar( 'image-gallery-1' ); ?>
I did it, as, I think you intended, in the above modified code. It worked, and I knew it would, but I was hoping there was a way to reuse the code without making a copy.

Thanks.
  #6  
Old Oct 10, 2012, 02:25 PM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by jerryc
I was hoping there was a way to reuse the code without making a copy.
Well, it's even better now. When I was repeating the code, the row of random images at the bottom could include some of the same images that were in the top row. Since I had to use a different sidebar at the bottom, I figured out a way to make the second row of random images not include any that were in the top row, and the code is much cleaner. It's shown here.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML markup validation errors? jms5017 Atahualpa 3 Wordpress theme 1 May 1, 2012 02:40 PM
Validation error with new widget in footer tracytrends New Versions, & Updating 11 Apr 14, 2012 01:48 PM
Widget Area validation error in W3.org mimi Sidebars & Widgets 4 Dec 6, 2011 05:17 AM
XHTML Strict Validation Error, Possibly from comments.php cyboc Comments, trackbacks & pings 0 Sep 9, 2009 02:57 PM
HTML Parsing Error IE8 DanGarion New Versions, & Updating 1 Jul 11, 2009 06:52 AM


All times are GMT -6. The time now is 09:34 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.