• The title says it briefly.
    Is it possible to use the wp_list_pages/wp_list_cats-tag and set an unique ID to each of the list-items?
    Maybe I can use the custom fields on pages and slug on the cats?
    If so I don’t know how I shall use them..

    My other question is;
    How can I wrap each list-item (once again wp_list_pages/wp_list_cats) inside a span, or how can I wrap a span round the list-item-text, but inside the list ;O

    here’s one example:

    <ul class="page">
    <li class="page_item current_page_item" id="unique1"><span><a href="#">Home</a></span>
    <li class="page_item" id="unique2"><span><a href="#">About</a></span>
    </ul>

    The reason why I’m wondering this is because I want to use pictures as links, but at the same time use text-links, so that a search engine would find my text-links.. the text-links just won’t be displayed in the browser..
    I’d be very thankfull if someone could help me! ;D

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter guzh

    (@guzh)

    doesn’t anyone know..? :/

    For Page lists, you can a spans inside list items by installing Page Lists Plus, going to Settings > Page Lists Plus, checking the “Add spans inside Page lists” box and saving.

    – Tim

    Hi

    I’m no php expert but adapted some code to replace and tags with <b> and </b> respectively for tab styling purposes. Idea is display cats here after replacement. You can use same idea to add <span> tags. Hope this helps…….

    N

    <li class=”<? echo (is_home())?’current-cat’:”; ?>”>/”><b>Home</b>
    <?php $cats = wp_list_categories(‘sort_column=menu_order&title_li=&echo=0’);
    $cats = preg_replace(‘%]+)>%U’,’<b>’, $cats);
    $cats = str_replace(‘
    ‘,'</b>’, $cats);
    echo $cats; ?>

    <li class="<? echo (is_home())?'current-cat':''; ?>"><a href="<?php echo get_option('home'); ?>/"><b>Home</b></a></li>
    <?php $cats = wp_list_categories('sort_column=menu_order&title_li=&echo=0');
    $cats = preg_replace('%<a ([^>]+)>%U','<a $1><b>', $cats);
    $cats = str_replace('</a>','</b></a>', $cats);
    echo $cats; ?>

    whoops here it is again

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_pages: set unique ID on list-items wrap list-items inside span’ is closed to new replies.