WordPress.org

Ready to get started?Download WordPress

Forums

Pages: customizing the list (7 posts)

  1. anela
    Member
    Posted 9 years ago #

    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

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

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

    thanks :)

  • ColdForged
    Member
    Posted 9 years ago #

    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.

  • anela
    Member
    Posted 9 years ago #

    Sounds okay to me... Do you know which file? Thank you :)

  • ColdForged
    Member
    Posted 9 years ago #

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

  • Rémi Prévost
    Member
    Posted 9 years ago #

    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);
    }

  • anela
    Member
    Posted 9 years ago #

    thank you :)

  • anela
    Member
    Posted 9 years ago #

    Oh yes, thank you both... :-)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.