Categories
CMS Mastering Development Wordpress

When looping by a specific variation it shows in stock if a different variation is in stock and need it to not display at all if out of stock

need major help with this one. So i have developed a fully from scratch woocommerce site on wordpress. Its for a client that has tons of different products and product variations. Now I have individual pages that are "shop by specific style page" . Here is my issue, I need to display a loop of […]

Categories
CMS Mastering Development Wordpress

Not able to go to page 2, 3, etc. in pagination – Static Home Page (wordpress)

I have a static home page on my WordPress blog and I cannot seem to figure this out. I want to be able to navigate between different pages in my blog via the pagination. I changed ‘paged’ to ‘page’ as I have seen that you should use ‘page’ for static home pages. However, when I […]

Categories
CMS Mastering Development Wordpress

Custom WP_Query not acknowledging search category & tag at the same time, but work independently

I have elaborate search functionality on one of my sites, it is using a custom WP_Query that will allow for an ‘AND’ & ‘OR’ relation between the users selections. It will then generate the result and overwrite the existing products in the product list. This is all being done using AJAX and a function within […]

Categories
CMS Development Wordpress

WP_Query | Help me create a search term with an ‘OR’ relation?

I have written a very elaborate script that will essentially allow the user to select from categories, tags and of course the search term. Then run these parameters through a WP_Query. I can successfully achieve the results I want using the ‘AND’ relation, this works for when the user populates search parameters into all fields; […]

Categories
CMS Development Wordpress

WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank

I have created a rather complex WP_Query, I need to restrict the arguments that are used within the query dependant on the users inputs. I appreciate I can wrap the whole argument in an IF statement, however if I try add an IF statement within the arguments, it breaks the website claiming there is a […]

Categories
CMS Development Wordpress

WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?

I began slightly baffled and have slowly degraded to slightly going insane as I am building this wp_query. Admittedly it is a very complex query and there is a lot of additional code that has brought me up to this point so here is the code that is key to helping me resolve to an […]

Categories
CMS Development Wordpress

Custom post types on page with filter and pagination

How to apply pagination to the filtered results when filter adds the string ‘?filtr=1’ after the domain name ? The filter works the following way… On my website (http://arche.cypis.net.pl/) after clicking ‘NAZWA’ filter in header I get the filtered results which output ‘project custom posts’ in alphabetic order, but I can’t work out how to […]

Categories
CMS Development Wordpress

woocommerce pagination with custom query using wc_get_products doesn’t work

I use the function wc_get_products to get the products I want. $paged = (get_query_var(‘paged’)) ? absint(get_query_var(‘paged’)) : 1; $ordering = WC()->query->get_catalog_ordering_args(); $ordering_explode = explode(‘ ‘, $ordering[‘orderby’]); $ordering[‘orderby’] = array_shift($ordering_explode); $ordering[‘orderby’] = stristr($ordering[‘orderby’], ‘price’) ? ‘meta_value_num’ : $ordering[‘orderby’]; $products_per_page = apply_filters(‘loop_shop_per_page’, wc_get_default_products_per_row() * wc_get_default_product_rows_per_page()); $product_ids_on_sale = wc_get_product_ids_on_sale(); $args = array( ‘status’ => ‘publish’, ‘include’ => $product_ids_on_sale, […]