WordPress.org

Support

Support » Themes and Templates » Pages: customizing the list

Pages: customizing the list

  • I’ve looked in the Codex and while I have found how to exclude pages and list them in different ordering, I still haven’t figured this out.

    How can I get it so that my list of pages displays a &raquo next to the item? You know, like a “before” item like you can specify in several plugins?

    So that:

      <li id="pagenav">
      <h2>Stuff</h2>
      <li class="page_item">Page 1

      <li class="page_item">Page 2

      <li class="page_item">Page 3

    Becomes:

    &lgt;ul>
    <li id="pagenav">
    <h2>Stuff</h2>
    <li class="page_item">&raquo ;Page 1

    <li class="page_item">&raquo ;Page 2

    <li class="page_item">&raquo ;Page 3

    thanks :)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Doesn’t appear to be a way to do that short of editing the core, though you could write a plugin that provides a new function just like it that simply inserts the character you want.

    Sounds okay to me… Do you know which file? Thank you 🙂

    Hell, I can tell you which line ;): wp-includes/template-functions-post.php, line 377.

    You can also edit the file “/wp-includes/template-functions-post.php” in which you look for a line that looks like this:

    echo $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page_id) . '" title="' . wp_specialchars($title) . '">' . $title . '</a>';

    and you replace it to:

    echo $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page_id) . '" title="' . wp_specialchars($title) . '">&raquo ; ' . $title . '</a>';

    But to be more semantic (because the page’s name is not “» My page”, it’s “My page”), you could juste make a custom bullet image (which would look like “»”) using

    li.page_item {
    list-style-image: url(images/raquo.gif);
    }

    thank you 🙂

    Oh yes, thank you both… 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pages: customizing the list’ is closed to new replies.
Skip to toolbar