WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Filter By Title Using Letters A* to O* (3 posts)

  1. gdisalvo
    Member
    Posted 1 year ago #

    <?php
    // Add pages you'd like to exclude in the exclude here
    wp_list_pages(
    array(
    'exclude' => '', 'title_li' => '',
    )
    );
    ?>
    This PHP works and will list all my pages ALPHAbetic. Is there a way to say I only want to see Pages in ALPHAbetic order Starting with "A" but up to Letter "O".

  2. Odai Athamneh
    Member
    Posted 1 year ago #

    You need to use regular expressions. For finding A through O:

    '/([a-oA-O]+)/'

    Put that string as the exclude parameter. It looks for A - O (upper or lowercase), and the + sign tells it to match more than one letter.

  3. gdisalvo
    Member
    Posted 1 year ago #

    Awesome Odai - thanks for the Response! I will give it a try.

Topic Closed

This topic has been closed to new replies.

About this Topic