Site logo

Archived topic

How to remove /page/2/ from home page?

5 replies · Started by Gregory on September 15, 2019

Viewing posts 1–6 of 6

Hello,

I'm using the seller theme with woocommerce. I would like to remove the page numbers (bottom of the page) from home page.
I checked woocommerce options... but I don't see how to remove it.
Home page is already a static page, I didn't modify anything the original theme.

Thank you

Hi there,

Not sure if I fully understand.

How will people see the second page of products without the paging navigation?

Let me know :)

Hi there,

your Home Page is currently only showing 8 products ( the dummy products that were imported with the Site ).

What you are showing there is the Shop (Product Archive) which is automatically generated to display ALL your products, if you remove that then how will ( as Leo said ) people find the other products?

Code goes in function.php file. It will show only featured products, it's what I wanted :)

// Display featured products in shop pages
add_filter( 'woocommerce_product_query_tax_query', 'custom_product_query_tax_query', 10, 2 );
function custom_product_query_tax_query( $tax_query, $query ) {
    if( is_admin() ) return $tax_query;

    if ( is_shop() ) {
        $tax_query[] = array(
            'taxonomy' => 'product_visibility',
            'field'    => 'name',
            'terms'    => 'featured'
        );
    }

    return $tax_query;
}

Glad to hear you got it working

This archived topic is closed to new replies.