I need help fixing a paged query within wordpress / woocommerce
- or -
Post a project like this1843
£30(approx. $38)
- Posted:
- Proposals: 7
- Remote
- #2348477
- Awarded
24/7 Expert WordPress, Shopify, Wix, Squarespace, Magento, Drupal, SEO, Joomla, Developer & Designer | Photoshop & Illustrator Master
London
Full Stack WordPress Developer specialised in Speed Optimisation, Website Support, Maintenance & Bug Fixes
London
Top rated PHP Web Development | WordPress | Magento | Drupal | OpenCart | PrestaShop | Joomla
Leicester
Software Engineer | WordPress | WooCommerce | SHOPIFY | PHP | LARAVEL | ROR | INTEGRATION |WEB DEVELOPMENT | THEME DEVELOPMENT | PLUGIN DEVELOPMENT |
Islamabad
Professional Writer, Logo Designing, WordPress, PHP, Custom Web Development and designing , Data Entry, Professional designers,
Bahawalpur
14254528771210507541205012176365321535562642387
Description
Experience Level: Entry
I am working on a wordpress/woocommerce website.
I have written a query that checks to see if the product archive page is a continuation page, and only executes some code / displays some custom fields if it is NOT.
So if it is /page/2/ for example, the code / custom fields should not be executed.
It works great on every category, except one! (which happens to be the first one the shop displays)
My query looks like this.
global $wp_query;
//if it's not the shop page and it's not a continuation page ...//
if (!is_shop() && get_query_var('paged') <= 0) {
//CODE TO DISPLAY PRODUCT CATEGORY DESCRIPTION//
//CODE TO DISPLAY SUB CATEGORIES AS YELLOW BUTTONS
//CODE TO DISPLAY PRODUCT CATEGORY MEDIA//
} else {
#Nothing for now.
}
I use it further down the page again so that it only displays the text underneath the product loop if it's not the shop page and not a continuation page -
if ( get_query_var('paged') <= 0){
$term = get_queried_object();
the_field('text_underneath_products', $term);
}
Again works perfect on every product category except the first one that's displayed in the shop.
Here's the product category that it's NOT working on:
http://spearo.angeldigital.marketing/spearguns/
you can see that on the continuation pages, it's incorrectly displaying
//CODE TO DISPLAY SUB CATEGORIES AS YELLOW BUTTONS
//CODE TO DISPLAY PRODUCT CATEGORY MEDIA//
but oddly not
//CODE TO DISPLAY PRODUCT CATEGORY DESCRIPTION//
And here's an example category where it IS working:
http://spearo.angeldigital.marketing/spearfishing-wetsuits/
(all of the other categories work I believe)
I will likely need help with a few other bits so would love to find a good wordpress developer to work with, going forward.
I have written a query that checks to see if the product archive page is a continuation page, and only executes some code / displays some custom fields if it is NOT.
So if it is /page/2/ for example, the code / custom fields should not be executed.
It works great on every category, except one! (which happens to be the first one the shop displays)
My query looks like this.
global $wp_query;
//if it's not the shop page and it's not a continuation page ...//
if (!is_shop() && get_query_var('paged') <= 0) {
//CODE TO DISPLAY PRODUCT CATEGORY DESCRIPTION//
//CODE TO DISPLAY SUB CATEGORIES AS YELLOW BUTTONS
//CODE TO DISPLAY PRODUCT CATEGORY MEDIA//
} else {
#Nothing for now.
}
I use it further down the page again so that it only displays the text underneath the product loop if it's not the shop page and not a continuation page -
if ( get_query_var('paged') <= 0){
$term = get_queried_object();
the_field('text_underneath_products', $term);
}
Again works perfect on every product category except the first one that's displayed in the shop.
Here's the product category that it's NOT working on:
http://spearo.angeldigital.marketing/spearguns/
you can see that on the continuation pages, it's incorrectly displaying
//CODE TO DISPLAY SUB CATEGORIES AS YELLOW BUTTONS
//CODE TO DISPLAY PRODUCT CATEGORY MEDIA//
but oddly not
//CODE TO DISPLAY PRODUCT CATEGORY DESCRIPTION//
And here's an example category where it IS working:
http://spearo.angeldigital.marketing/spearfishing-wetsuits/
(all of the other categories work I believe)
I will likely need help with a few other bits so would love to find a good wordpress developer to work with, going forward.
Jen W.
100% (41)Projects Completed
36
Freelancers worked with
28
Projects awarded
50%
Last project
12 Feb 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies