Specify number of posts for sub-category page

OK, how about this then? (Changed from first try – now tested.) function my_post_queries( $query ) { if ( ! is_admin() && $query->is_main_query() ) { if ( is_category( 7 ) ) { $query->set( ‘posts_per_page’, 6 ); } //works with pretty permalinks $cat_id = get_queried_object()->term_id; if ( cat_is_ancestor_of( 7, $cat_id ) ) { $query->set( ‘posts_per_page’, 12 … Read more

Validation algorithm in checkout field

First of all, you need to learn WordPress Plugin development, especially how to use WordPress Hooks: https://developer.wordpress.org/plugins/hooks/ Then, you need to learn how to implement Woocommerce specific hooks: https://docs.woocommerce.com/document/introduction-to-hooks-actions-and-filters/ Finally, use appropriate Woocommerce hook to filter & validate Personal Identification Number provided by the user according to your algorithm. Since it’s not clear at what … Read more