• Hi Tony,

    Great plugin!

    I’m working on a biology site and found that I can list categories and post using this plugin. But there is no way of ordering the posts alphbetically. They are ordered in reverse date order. Also, I couldn’t find a way of not showing the word: “Category:” in the list.

    So I made a couple of changes to the code, hoping that you’d like to include this as native options that can be changed via the Sitemap page settings on the next upgrade.

    This is how the page looks, it is basically a table of contents that allow people to find the species: https://panamasilvestre.com/indice/

    To enter while it is in construction, please enter first to https://panamasilvestre.com/tempo

    The changes I made are:
    Changed:
    Line 1044
    .sprintf( __('Category: %1$s', 'wp_sitemap_page'), '<a href="'.get_category_link($page->cat_ID).'"'.$attr_nofollow.'>'.$page->name.'</a>' )

    To:
    .sprintf( __('%1$s', 'wp_sitemap_page'), '<a href="'.get_category_link($page->cat_ID).'"'.$attr_nofollow.'>'.$page->name.'</a>' )

    After line 1105 added:
    $args = array( 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC' );

    Thanks in advance,

    Humberto

    https://www.ads-software.com/plugins/wp-sitemap-page/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Tony Archambeau

    (@funnycat)

    Hi nugmeister,
    thank you for your message and for your code.
    Here is a small tip to get the sitemap without the word “category”, just use the following code :
    [wp_sitemap_page only=”post” display_title=”false”]
    Thanks anyway, I will try to add such a feature of an alphabetical order.

    Have a nice day.
    Sincerely,
    Tony

    Thread Starter nugmeister

    (@nugmeister)

    Hi Tony,

    Thanks to you too. I’ll use that code.

    Cheers,

    Humberto

    Hello nugmeister and Tony,

    I tried this in an effort to answer my question posted a few days ago.
    It did not work for me.
    I changed the wp-sitemap-page/wp-sitemap-page.php file.
    Was this the correct file to change?

    I also really need to alphabetize Projects ie custom posts as that is how I am building my library of plants.
    Please see my thread for more information.

    https://www.ads-software.com/support/topic/alphabetical-order-custom-posts-ie-projects-separated-by-category?replies=2

    Any help would be greatly appreciated.

    Thread Starter nugmeister

    (@nugmeister)

    Hi again, Tony,

    display_title="false"

    Doesn’t work, I’m sorry to say.

    Cheers,

    Humberto

    Thread Starter nugmeister

    (@nugmeister)

    Hi Tim D,

    Did you change the two lines and commented the original ones?

    Humberto

    I replaced the lines as you instructed.

    I do not understand what you mean by commenting on the original ones.

    Should I have left the original text and posted yours following it?

    Thread Starter nugmeister

    (@nugmeister)

    Hi Tim,

    What program did you use to change the lines?

    Commenting means in this case, placing two // before the line, so it gets disabled.

    Cheers,

    Humberto

    Hi nugmeister.
    I did as you recommended but no luck.
    I am using Notepad++ as was indicated by Tony in another thread.
    I left the original code but input the comment markup as you indicated.
    This is copied right out of the php file…

    Starting at line 1042
    $html .= “\t”.’

    Thread Starter nugmeister

    (@nugmeister)

    Hi Tim,

    I’m not a programmer, but I would suggest placing the line

    $args = array( 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC' );

    Before this line:
    $the_posts = get_posts( $args );

    Cheers,

    Humberto

    For my custom post type Alpha order, i change line 858 by the one you provide and it save my day! Thank you.

    Thread Starter nugmeister

    (@nugmeister)

    Goopd to know, Ataxel ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Alphabetical order of posts and other change’ is closed to new replies.