Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] html validation error with sidebar used twice on page (http://forum.bytesforall.com/showthread.php?t=18630)

jerryc Oct 10, 2012 12:23 AM

[SOLVED] html validation error with sidebar used twice on page
 
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

juggledad Oct 10, 2012 04:41 AM

What slider is it

jerryc Oct 10, 2012 05:39 AM

Quote:

Originally Posted by juggledad (Post 91172)
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.

juggledad Oct 10, 2012 08:52 AM

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' ); ?>

jerryc Oct 10, 2012 11:39 AM

Quote:

Originally Posted by juggledad (Post 91187)
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.

jerryc Oct 10, 2012 01:25 PM

Quote:

Originally Posted by jerryc (Post 91195)
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.


All times are GMT -6. The time now is 08:52 AM.

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