Skip Navigation

[Resolved] Show Hidden links

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

Our next available supporter will start replying to tickets in about 4.29 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by David Gimenez 2 years, 1 month ago.

Assigned support staff: 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!