Ulcecurce
Forum Replies Created
-
So i solved this problem with adding this code inside contact-form-seven-functions.php:
add_action( ‘wpcf7_submit’, ‘wpb_query_after_submit’ );
function wpb_query_after_submit() {
$wordpress_post = array(
‘post_title’ => ‘Post title’,
‘post_content’ => ‘Post Content’,
‘post_status’ => ‘publish’,
‘post_author’ => 1,
‘post_type’ => ‘page’
);wp_insert_post( $wordpress_post );
}
And it works. Thanks!
Hi, George, and thanks for your reply.
I tried get_category_ids(), but it does not work from a template….
I also tried [wcpbc_country_selector], but it shows “Other countries” too
So, i found the solution. Just add this code to theme’s functions.php file:
// this creates a widget shortcode functionality (use with [widget widget_name="WCAPF_Active_Filters_Widget"] shortcode) function widget($atts) { global $wp_widget_factory; extract(shortcode_atts(array( 'widget_name' => FALSE ), $atts)); $widget_name = wp_specialchars($widget_name); if (!is_a($wp_widget_factory->widgets[$widget_name], 'WP_Widget')): $wp_class = 'WP_Widget_'.ucwords(strtolower($class)); if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')): return '<p>'.sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct"),'<strong>'.$class.'</strong>').'</p>'; else: $class = $wp_class; endif; endif; ob_start(); the_widget($widget_name, $instance, array('widget_id'=>'arbitrary-instance-'.$id, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '' )); $output = ob_get_contents(); ob_end_clean(); return $output; } add_shortcode('widget','widget');
And after that we can use shortcodes like [widget widget_name=”WCAPF_Active_Filters_Widget”] or [widget widget_name=”WCAPF_Category_Filter_Widget”] or [widget widget_name=”WCAPF_Price_Filter_Widget”] in our pages.
Finally i found the solution in documenation – all i need is to activate options “show count”, “dynamic recount” and “hide empty terms” in woof plugin settings. Also the shortcode in older versions of woof must be like this – [woof is_ajax=1 taxonomies=product_cat:8] , where 8 -is id of products category, snd if we have more fresh lugin version, as far as i can understand, we can just use [woof]. Also, it is better to turn on “Try Ajax” in plugin settings to make filter working with no redirects. Thanks!