User register hook is not working in woocomerce register form

user_register action hook is performed without any output, therefore you can’t echo anything from it. If you’re looking to debug the output from this function, dump it to the error log. function send_coupon_to_freshly_registered_user($user_id) { $user = get_user_by(‘id’,$user_id); //new line $user_email = stripslashes($user->user_email); //changed line error_log( print_r( $user_email, true ) ); // print_r the variable to … Read more

Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args

The error happens because the filter callback (shapeSpace_disable_sitemap_post_meta()) expects to receive two parameters ($args and $post_type) and yet you call add_filter() without setting the fourth parameter to 2. So to solve the problem: // Replace this: add_filter(‘wp_sitemaps_posts_query_args’, ‘shapeSpace_disable_sitemap_post_meta’); // with this one: add_filter(‘wp_sitemaps_posts_query_args’, ‘shapeSpace_disable_sitemap_post_meta’, 10, 2);

unable to use ‘new WP_Query’ in AJAX call

Just to clear this up for someone that might have similar problem, everything was find with query, the problem with this was WordPress was looking for WP_Query class in namespace file, replacing new WP_Query with new \WP_query solved this problem 😀 thanks for help!

How do I modify the custom footer text and get theme version number to show in wordpress admin?

Try returning your span instead of echoing it. function modify_admin_footer() { return ‘<span id=”footer-thankyou”>Developed by <a href=”http://www.toolcart.com” target=”_blank” rel=”noopener noreferrer”>Toolcart Theme Version:</a>.</span>’ . wp_get_theme()->parent()->Version; } add_filter( ‘admin_footer_text’, ‘modify_admin_footer’ );

Wrapping a Sidebar within

UPDATE: now that the post is clarified, in your custom sidebar declaration change these lines to the following (this preserves existing wrappers too, which are advisable to leave in unless you know you want to delete them): ‘before_widget’ => ‘<div class=”customdiv”><div class=”widget-content”>’, ‘after_widget’ => ‘</div></div>’, I assume you’re trying to edit a system-loaded sidebar. Try … Read more

Edit the_category (); for a hierarchical display

You could assign the post only to the child category, and call the function like so: the_category( ‘ ‘, ‘multiple’ ); This will output (notice the whitepsace between the anchor tags): <a href=”https://example.com/category/parent/”>parent</a> <a href=”https://example.com/category/parent/child/” rel=”category tag”>child</a>