Support » Plugin: A-Z Listing » How do I make the index for pages only?

  • Resolved auroralebeouf

    (@auroralebeouf)


    Hello,

    Is it possible to make the index for pages only? I have ton of pages which needs to be organized but I want to keep single posts out of it.

    Is it possible to make it organize via Page Titles, instead of tags or catagories?

    Im not very fluent in code, so any help will be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Daniel Llewellyn

    (@diddledan)

    Hi,

    The plugin is built to show pages by default unless it is overridden in the shortcode or via PHP.

    You can ensure it shows pages by either removing any post-type arguments in your usage or by specifying page as the post-type.

    See the FAQ item titled “How do I show posts of a different post-type (not pages) or multiple post-types (e.g. posts AND pages)” for help to specify the post-type to display.

    I have the opposite problem. All it’s showing is the pages instead of the posts, despite selecting posts in the widget. I do have about 6600 posts. Is that considered excessive?

    I also tried the shortcode [a-z-listing] in one of the pages but then most of the site became inaccesible (blank pages). All I want are the titles with the links.

    • This reply was modified 2 years, 5 months ago by  winkelr.

    I could try reactivating it at a particular time so someone could look at it. But as I said it takes my site down so I don’t want to leave it on for long.

    I had another plug-in still activated, no wonder I couldn’t see the pages. My apologies. Its organizing pages by default like you said and it looks awesomes. :0)

    But now, I have another problem. I have a few pages that I DO NOT want, like the About Me page. Is there a php code I can use to exclude some pages like my About Me page and such?

    Plugin Author Daniel Llewellyn

    (@diddledan)

    @winkelr, 6600 posts might be the issue. There is no caching at the moment, and large lists currently load the entire list in one step rather than breaking up the work.

    @auroralebeouf, to prevent certain pages from appearing in the list you need to, currently, use the PHP method. Create a new template file with the appropriate header comment e.g. Template: my-super-a-z-listing-template and assign that to the page on which you currently use the shortcode. Remove the shortcode (else you’ll get two lists 🙂 and save the page. In the template, copy everything out of index.php from your theme and remove the entirety of “the loop” (usually between while ( have_posts() ) : and endwhile and replace with:

    <?php
    the_a_z_listing( array(
      'post__not_in' => array( 1, 2, 3 )
    ) );

    Replace the list of 1, 2, 3, with the page ID numbers separated by commas of any page you want to exclude from the output. Alternatively, you can use post__in instead and include the page IDs of all the pages you want to list rather than exclude.

    Plugin Author Daniel Llewellyn

    (@diddledan)

    I’ve marked this as resolved, but please come back if you want or need further discourse or assistance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I make the index for pages only?’ is closed to new replies.