WordPress.org

Ready to get started?Download WordPress

Forums

Mixed code an style in WordPress forces Theme-Layout (2 posts)

  1. anschitech
    Member
    Posted 7 years ago #

    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.

  2. 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?

Topic Closed

This topic has been closed to new replies.

About this Topic