Changing the HTML of notices in WooCommerce [closed]

After talking with some of the WooCommerce people on Slack, I realized that the problem here is probably this pattern, in frontend/cart.js – due to the fact, that my store uses the AJAX functionality that WooCommerce provides. var show_notice = function( html_element, $target ) { if ( ! $target ) { $target = $( ‘.woocommerce-notices-wrapper:first’ … Read more

Pagination not working – FrontPage

I use this on archive pages. If you are trying to use it elsewhere then that might be a cause of the issue. if ( ! function_exists( ‘_s_pagination_links’ ) ) : /** * Numbered pagination */ function _s_pagination_links() { global $wp_query; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1){ $current_page = max(1, get_query_var(‘paged’)); echo paginate_links(array( ‘base’ … Read more

display condition based on post term and status

You are populating the $term variable with a multidimensional array, but type-and-value checking it (===) against a string. Second, you say terms are ‘des_1’ and ‘des_1’ (with underscore), but are checking for ‘des-1’ (with dash). wp_get_post_terms will return an array of term objects, so you should might be better of with has_term() for checking if … Read more

Different number posts per page based on custom post type term id

You can achieve it with pre_get_posts. With your current code there are multiple syntax errors. You have write it this way add_filter(‘pre_get_posts’, ‘limit_change_posts_archive’); function limit_change_posts_archive($query){ if ( !is_admin() && $query->is_main_query() && is_archive() && is_tax( ‘pdsh_categories’ ) && is_term( 1858 )) { $query->set(‘posts_per_page’, -1); } return $query; } As is_term is deprecated a different approach can … Read more