• Hi Daniel,

    I need please help.

    I have wordpress based web page with a lot of sites and use your a-z listing plugin. Some of my pages contain numbers in titel and other pages not. My numbered pages start with numbers from 1 to 10.

    The a-z plugin works fine and lists all my sites. Numbered pages are displayed under # or 0-9, depends on short code I used.

    But I would like to hide/remove pages wich contain numbers in the titel from a-z listing. How can I do this?

    Please help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    You will need to write some customised PHP code to achieve this goal. There is a filter called a-z-listing-filter-items that can be used somewhere like your theme’s functions.php file:

    add_filter( 'a-z-listing-filter-items', 'filter_a_z_listing_numbered_posts', 10, 3 );
    function filter_a_z_listing_numbered_posts( $items, $this->type, (array) $query ) {
        return array_filter( $items, function( $item ) {
            // negate because we want all the posts that do *not* start with a number
            ! in_array( mb_substr( $item->post_title, 0, 1, 'UTF-8' ), range( 0, 9 ) );
        } );
    }
    Thread Starter alexpoljot

    (@alexpoljot)

    Good Morning Daniel,

    thank you very much for your reply. Unfortunaly is it for me not possible to write customized PHP code because Im not a programmer and my knoledge is on lowest basic niveau.

    Lets summarize to ensure that I got you right.
    I need to insert the posted code above into the function.php of my theme. Right?
    And then it schould enjoy the result of sorted list without nummbers-topics! ??

    Best Regard from Nuremberg!

    • This reply was modified 3 years, 7 months ago by alexpoljot.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Pages titeled with numbers from listing’ is closed to new replies.