Support » Themes and Templates » 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.
    In get_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.

Viewing 1 replies (of 1 total)
  • I think quite a few changes have been made in 2.1 towards the goal of making the template tag functions contain as little hard coded html as possible.

    Does the new wp_lists_bookmarks functionality coming in WordPress 2.1 satify your needs?

Viewing 1 replies (of 1 total)
  • The topic ‘Mixed code an style in WordPress forces Theme-Layout’ is closed to new replies.