WordPress.org

Ready to get started?Download WordPress

Forums

How to add icon "new" to the specific subcategory in sidebar? (5 posts)

  1. demask
    Member
    Posted 3 years ago #

    Hi all,

    How to add icon "new" to the specific page link in sidebar?

    My theme calls WordPress built-in function dynamic_sidebar() to display sidebar which consist of page links and I would like to mark the new pages with the small "new!" stamp.

    I know how to add icon to *all* page links in sidebar with the following CSS code:

    #subcontent ul.pages li, #subcontent ul li, #subcontent ul li.page_item {
      padding-right:10px;
      background: url(../images/spring_flavour/new.gif) top right no-repeat;
    }

    But what is the way to add such icon to the *specific* page only? Without hacking into WordPress dynamic_sidebar() code.

    Many thanks,
    Dmitriy

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Is your menu being generated via wp_list_pages(), or via wp_nav_menu()?

  3. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    p.s. hacking into dynamic_sidebar() isn't going to help you in any way whatsoever.

  4. demask
    Member
    Posted 3 years ago #

    Menu is being generated manually. There is a cycle using get_pages() and printing HTML link to the each page using echo and get_page_link().

  5. demask
    Member
    Posted 3 years ago #

    So, does anyone know what would be the best approach to add icon with logo "new!" to the specific page link in sidebar?

Topic Closed

This topic has been closed to new replies.

About this Topic