• bpetruzzo

    (@bpetruzzo)


    I’ve been searching around but I couldn’t find an answer to this question, although I’m pretty confident that it’s not an especially difficult problem.

    Currently, my menu displays like this:
    HOME ABOUT ME BLOG POLICY BOOK REVIEWS

    I would like to add “\\” characters between the pages, like this:
    HOME \\ ABOUT ME \\ BLOG POLICY \\ BOOK REVIEWS

    I’ve found a few topics for adding the pipe character using CSS, but that’s really not what I’m looking to do.

    How can I tell WP_LIST_PAGES to add “\\” between each page?

Viewing 5 replies - 16 through 20 (of 20 total)
  • dpcalhoun,

    Always happy to lend a hand :-). Good luck in your travels.

    I found this thread very useful. Thanks all!

    @capn Code
    Is there a way I can edit the code to do the same thing for Categories?

    Many thanks!

    Hi Peter,

    It’s accomplished much the same way:

    $categories = wp_list_categories('title_li=&echo=0');
    $categories = explode('</li>', $categories); //create array from string returned by wp_list_categories
    array_pop($categories); //pop last element off array
    echo implode(' | ', $categories);

    I’ve also used some CSS to accomplish this recently.

    li:after {
    	content: "|";
    }
    
    li:last-child:after {
    	content: "";
    }
Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Adding special characters between menu items using WP_LIST_PAGES’ is closed to new replies.