Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ben Huson

    (@husobj)

    An interesting use case…

    Not possible with current version, but with a couple of tweaks and a bit of code you can achieve this. Was interested to see if it was possible so I had a play…

    First you need to edit the List Pages Shortcode plugin and make these changes:

    The following 2 lines of code (appear separately in the code)…

    do_action( 'shortcode_list_pages_before' );
    do_action( 'shortcode_list_pages_after' );

    …need to be changed to:

    do_action( 'shortcode_list_pages_before', $atts, $content, $tag );
    do_action( 'shortcode_list_pages_after', $atts, $content, $tag );

    I will ensure these changes are in the next release of the plugin.

    To add support for pages starting with certain letters is more tricky, but i have posted the code here.

    It will also you you use the shortcode like this:

    [list-pages sort_order="ASC" sort_column="post_title" index="0123456789ABCDEF" title_li="A-F" /]
    [list-pages sort_order="ASC" sort_column="post_title" index="FGHIJKLM" title_li="F-M" /]
    [list-pages sort_order="ASC" sort_column="post_title" index="NOPQRST" title_li="N-T" /]
    [list-pages sort_order="ASC" sort_column="post_title" index="UVWXYZ" title_li="U-Z" /]

    Hope that helps ??

    Thread Starter coreyalderin

    (@coreyalderin)

    Thank you so much. This is going to save me a lot of time. I will test it out today and let you know how it goes.

    Thread Starter coreyalderin

    (@coreyalderin)

    It does not seem to be working for me.

    I may have done something wrong though. I changed the 2 lines that you said to do first. That seemed straight forward.

    For your second part, was I supposed to create a new file called “list-pages-shortcode-index.php” and then save it in the “/list-pages-shortcode” folder? That’s what I did.

    Then I used this shortcode:

    [child-pages sort_order="ASC" sort_column="post_title" index="0123456789ABCDEF" title_li="A-F" /]
    [child-pages sort_order="ASC" sort_column="post_title" index="FGHIJKLM" title_li="F-M" /]
    [child-pages sort_order="ASC" sort_column="post_title" index="NOPQRST" title_li="N-T" /]
    [child-pages sort_order="ASC" sort_column="post_title" index="UVWXYZ" title_li="U-Z" /]

    But when I look at the page, it actually lists all the pages 4 times.

    Did I do something wrong? Does this work with “child-pages”?

    Thanks

    Plugin Author Ben Huson

    (@husobj)

    I have updated the code so that it can be used like a plugin – download it here.

    Just drop it in your plugins folder an activate it from the plugins screen in your admin.

    Thread Starter coreyalderin

    (@coreyalderin)

    I still can’t get it to work for me. It still shows every child page, instead of the pages that start with specific letters.

    Should it work with the slight modification I made to the shortcode? I changed “list-pages” to “child-pages”

    Thread Starter coreyalderin

    (@coreyalderin)

    Hi Ben

    Were ou able to test this and get it to work for you? I still can;t seem to get it to work. Thanks for all your help

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘LIst of subpages with specific criteria. Is this possible?’ is closed to new replies.