Skip Navigation

[Resolved] Alphabetically sorting

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1109333

Hi there,

Is it possible to create A-Z indexing on this page: hidden link or we can put a dropdown with release year like

Movies Release in 2016
Movies Release in 2017
Movies Release in 2018
Movies Release in 2019

and it sorts movies released in the respective years. In Custom Fields I have a section where I insert release full date.

Looking forward to your response.
Thanks

#1109408

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - if you want to build glossary filter (A....Z), please try to follow the following steps:

1)
Create a taxonomy namely "alphabets" and add A to Z as terms.

2)
Now create a new view that will list all the terms for taxonomy "alphabets". The loop output section should look like this:

[wpv-layout-start]
    [wpv-items-found]
    <a href="[current_url]">All</a>
    <!-- wpv-loop-start -->
        <wpv-loop>
            <a href="?wpvalphabet=[wpv-taxonomy-title]">[wpv-taxonomy-title]</a>
        </wpv-loop>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

-- Add following code to your current themes funcitons.php file

/**
 * Register custom shortcode to output url of current page
 * Minus any url parameters
 */
add_shortcode( 'current_url', function(){
   
    $request = $_SERVER['HTTP_HOST'].strtok($_SERVER["REQUEST_URI"],'?');
    $protocol = '<em><u>hidden link</u></em>';
   
    if ( $_SERVER['HTTPS'] ) {
        $protocol = '<em><u>hidden link</u></em>';
    }
   
    return $protocol . $request;
} );

3)
Now create another view for which you want to display your posts filter by the taxonomy "alphabets" as URL param.

[wpv-layout-start]
[wpv-view name="alphabet-terms"]
[wpv-items-found]
<!-- wpv-loop-start -->
        <wpv-loop>
            <h3>[wpv-post-link]</h3>
        </wpv-loop>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

More info:
=> https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/

#1111677

So every-time we have to select taxonomy letter ?

#1112044

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - that's correct. You need to click on taxonomy letter to filter the results.