WordPress.org

Ready to get started?Download WordPress

Forums

HTML Page Sitemap
Why are WP added default classes removed? (6 posts)

  1. Mohan Chevuri
    Member
    Posted 1 year ago #

    What is the reason for removing class attribute from
    li added by wp_list_pages? (Line 50)

    http://plugins.trac.wordpress.org/browser/html-sitemap/trunk/html-sitemap.php#L50
    http://wordpress.org/extend/plugins/html-sitemap/

  2. Angelo Mandato
    Member
    Plugin Author

    Posted 11 months ago #

    The wp_list_pages function is intended to be used outside of the content area, in the header, footer or sidebar. Many themes use these classes added by wp_list_pages to apply styling for any one or all of those areas. Since this plugin puts the unordered list in the content, it should not take on such styling. In our testing, with some themes it made it look like the sidebar was accidentally placed in the page content. Removing the class made the unordered list look like other unordered lists in the page content.

    Is there a reason you want those specific classes applied?

  3. Mohan Chevuri
    Member
    Posted 11 months ago #

    We came across an instance to add borders for some selected items in the list, when sitemap is used as content. Removing class makes sense. What do you think about replacing it with class="sitemap_class1 sitemap_class2..."?

    Btw, this is a simple yet powerful shortcode.

    Thank you
    Mohan

  4. Angelo Mandato
    Member
    Plugin Author

    Posted 11 months ago #

    I think it's a good idea to pass in the class in the shortcode. I've added it to my TODO list.

    In the short term, you can easily wrap the list in a span or a div with a class or ID to style all the children elements. e.g.

    <span id="page_list">[html-sitemap]</span>

    CSS:

    #page_list ul {
    
    }
    #page_list ul li {
    
    }
    ...
  5. Fill in the Blank
    Member
    Posted 6 months ago #

    yes a simple "class" or "id" identifier in the shortcode would be awesome. Even if you injected your own class upon using the ul. like <ul class="html-sitemap">

  6. Angelo Mandato
    Member
    Plugin Author

    Posted 6 months ago #

    Yes, class and id are good ideas and they are on my TODO list.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.