Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I logged in to your FTP and renamed the plugins folder to plugins.disable and then I try to acess the wp-admin URL.
But when I try to access the wp-admin, I still see the following message with blank page:
Forbidden
You do not have permission to access this document.
Can you please make sure I should be able to access the admin.
We are thinking that it is a caching issue. We reset everything and accessed it from a remote location and it is working. We are very sorry for all of this, please try it one more time.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Can you please check now: hidden link
As there is no way to pass the shortcode argument to Block views, I've added the following view's filter that will allow us to pass the current post title dynamically and filter the view. I've added the following code to "Custom Code" section offered by Toolset:
add_filter( 'wpv_filter_query', 'func_custom_title_filter', 10, 3 );
function func_custom_title_filter( $query, $view_settings, $views_id ) {
if ( $views_id == 56945 ) {
global $WP_Views;
global $post;
if(isset($WP_Views->view_shortcode_attributes[0])){
$query['s'] = $post->post_title;
}
}
return $query;
}
I can see its working as expected, Can you please confirm it works at your end as well.
Yes this is what I was expecting. I would need to create another section for another show, would I be able to use the same custom js cote with the duplicate view?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Yes this is what I was expecting. I would need to create another section for another show, would I be able to use the same custom js cote with the duplicate view?
==>
This is not JS code but Toolset hook which is based on php.
If you want to apply the view to multiple view IDs, you should change the following line of code:
if ( $views_id == 56945 ) {
To:
$target_view_ids = array( 56945,9999,8888 );
if ( in_array( $view_id, $target_view_ids) ) {
Where:
- You can replace 9999 and 8888 with your targeted view IDs.
I added another view called "Qweens with Look at Huh" (id=57272) in the same content template.
So I changed the php code like instructed above but it is not working now.
add_filter( 'wpv_filter_query', 'func_custom_title_filter', 10, 3 );
function func_custom_title_filter( $query, $view_settings, $views_id ) {
$target_view_ids = array( 56945,57272 );
if ( in_array( $view_id, $target_view_ids) ) {
global $WP_Views;
global $post;
if(isset($WP_Views->view_shortcode_attributes[0])){
$query['s'] = $post->post_title;
}
}
return $query;
}
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Can you please try the following code:
add_filter( 'wpv_filter_query', 'func_custom_title_filter', 10, 3 );
function func_custom_title_filter( $query, $view_settings, $views_id ) {
$target_view_ids = array( 56945,57272 );
if ( in_array( $views_id, $target_view_ids) ) {
global $WP_Views;
global $post;
if(isset($WP_Views->view_shortcode_attributes[0])){
$query['s'] = $post->post_title;
}
}
return $query;
}
It should work. The variable name is $views_id not $view_id that I've corrected with the above code.
My issue is resolved now. Thank you!
For future update, is it possible to add the option for filter by search with an dynamic string (such as post title, etc) to the toolset block ?