Mixed code an style in WordPress forces Theme-Layout
-
Hi,
yesterday I found out, that wordpress uses in some functions tags which force the designer to use mandatory style elements.
Inget_links_list(), used e.g. in my Sidebar, the return value is wrapped in<li></li>tags, which forces the designer to use<ul>or<ol>for the sidebar. I prefer<fieldset>to group my sidebar-items.
I changed the function not to return the<li></li>wrapper around the returned<ul>-list.
It is bad for a theme, when return values expect to be in a special environment as<ul>.
One problem with changing the functions behaviour is, that old themes will break. On the other hand it gives the designer more flexibility to format his theme.
get_links_list() is not the only function that return a<li></li>wrapper around the returned code.
Some functions even have ‘hard’ coded styles for headers for lists as<h2>.
I would suggest to clean the wordpress code, so that no styles are hard coded to wordpress functions. Functions that return a list should be changed to accept a parameter as how to format the header of that list(e.g.<h2>,<h3>or<legend>), possibly with a default value when no parameter is given.
The topic ‘Mixed code an style in WordPress forces Theme-Layout’ is closed to new replies.