AntonShevchuk / wp-constructor

Wordpress Constructor Theme for those who want to create a unique blog design quickly and effortlessly
https://wordpress.org/themes/constructor/
0 stars 0 forks source link

html 'id' and 'class' for widgets in dynamic sidebars #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. default install

What version of the ... are you using?
1. Wordpress: 2.9.2
2. Constructor: 0.8.0
3. Browser: FF
4. OS: Debian

What URL of your blog(s)?
1. still in dev.

Please provide any additional information below.

Hi, this is a small enhancement.  When wordpress generates the html for
widgets in dynamic sidebars, it uses sprintf() to fill in the html id and
class of the widget with widget-specific information so that it can be
styled specific to that widget.

Where wordpress does the sprintf:

http://core.trac.wordpress.org/browser/tags/2.9.2/wp-includes/widgets.php#L876

Wordpress defaults for the sprintf:

http://core.trac.wordpress.org/browser/tags/2.9.2/wp-includes/widgets.php#L552

Here's a patch to add this functionality to constructor.  Cheers.

mike@ln-dev:/var/www/fogel/wp-content/themes$ diff
constructor.org/functions.php constructor/functions.php
24c24
<         'before_widget' => '<li>',

---
>         'before_widget' => '<li id="%1$s" class="widget %2$s">',
26c26
<         'before_title' => '<h3>',

---
>         'before_title' => '<h3 class="widgettitle">',
32c32
<         'before_widget' => '<li>',

---
>         'before_widget' => '<li id="%1$s" class="widget %2$s">',
34c34
<         'before_title' => '<h3>',

---
>         'before_title' => '<h3 class="widgettitle">',
40c40
<         'before_widget' => '<div class="widget">',

---
>         'before_widget' => '<div id="%1$s" class="widget %2$s">',
42c42
<         'before_title' => '<h3>',

---
>         'before_title' => '<h3 class="widgettitle">',
48c48
<         'before_widget' => '<li>',

---
>         'before_widget' => '<li id="%1$s" class="widget %2$s">',
50c50
<         'before_title' => '<span>',

---
>         'before_title' => '<span class="widgettitle">',
56c56
<         'before_widget' => '<div class="widget">',

---
>         'before_widget' => '<div id="%1$s" class="widget %2$s">',
58c58
<         'before_title' => '<h3>',

---
>         'before_title' => '<h3 class="widgettitle">',
321c321
< }

Original issue reported on code.google.com by mjfo...@gmail.com on 21 Feb 2010 at 2:53

GoogleCodeExporter commented 9 years ago

Original comment by AntonShe...@gmail.com on 23 Feb 2010 at 7:24

GoogleCodeExporter commented 9 years ago

Original comment by AntonShe...@gmail.com on 1 Mar 2010 at 5:16