Skip Navigation

[Resolved] Show Hidden links

This support ticket is created 4 years, 2 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by David Gimenez 4 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1610981

Hi.

I'd like to see the hidden links of this post: https://toolset.com/forums/topic/filtering-artist-by-selecting-the-first-letter-of-the-title/#post-602852

Is it possible?

Thanks!

#1611381

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

While i'm unable to unhide the links due to the thread not being my own, I can however paste the solution here for you.

[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_shortcode( 'current_url', function(){
   
    $request = $_SERVER['HTTP_HOST'].strtok($_SERVER["REQUEST_URI"],'?');
    $protocol = '<em><u>hidden link</u></em>';
   
    if ( isset($_SERVER['HTTPS']) ) {
        $protocol = '<em><u>hidden link</u></em>';
    }
   
    return $protocol . $request;
} );
[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]
add_filter('wpv_filter_query', 'func_filter_by_title', 10, 2);
function func_filter_by_title($query, $setting) {
 
global $wpdb;
     
if($setting['view_id'] == 9999) {
         
        if(isset($_GET['wpvalphabet']) and $_GET['wpvalphabet']!='' ){
             
             
            $first_char = $_GET['wpvalphabet'];
            $postids = $wpdb->get_col($wpdb->prepare("SELECT      ID
                                                        FROM        $wpdb->posts
                                                        WHERE       SUBSTR($wpdb->posts.post_title,1,1) = %s
                                                        AND post_type = '".$query['post_type'][0]."'
                                                        AND post_status = 'publish'
                                                        ORDER BY    $wpdb->posts.post_title",$first_char)); 
                                                         
                  $query['post__in'] = $postids;
                  }
  }
return $query;
}

Please let me know if this helps.

Thanks,
Shane

#1612419

My issue is resolved now. Thank you!

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.