Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Waiting for user confirmation] wpv-if won't work

$
0
0

Dear Luo,

wpv-ifs do work if I remove the code. But I need to use the wpv-extra-condition-filters as outlined by you in this post:
http://wp-types.com/forums/topic/shortcodes-as-conditions-for-wpv-if/

Within the loop of a view I need to figure out which child-posts belong to the post on which the current view is shown.

Here is the whole function:

add_filter('wpv-extra-condition-filters', 'my_filter');
function my_filter($evaluate)
{
if($evaluate == 'show_corresponding_faq')
{
global $page_object, $post;
$page_object = get_queried_object();
$page_id = get_queried_object_id();

$parent_id = get_post_meta($post->ID, '_wpcf_belongs_productpages_id', true);
$post_title = get_the_title($post->ID);

if($page_id == $parent_id && $post_title != '') {
return '0<1';
} else {
return '0>1';
}
}
}

Do you have any idea how to do this without using the filter?

Best regards,
Florian


Viewing all articles
Browse latest Browse all 20145

Trending Articles