• Resolved alwayspaws

    (@alwayspaws)


    Hello,

    I have sections on my homepage that I don’t want. The products under the sections are definitely not what I want showing. I only want a featured products section. I never added any of these sections:

    new in, we recommend, best sellers, fan favorites.

    I can’t locate where those settings are to delete, rename or to add the products I want.

    I want to keep the shop by category section.

    I took screenshots but can’t add images to the forum. When I’m in customization in the woocommerce section, it doesn’t show the extra sections.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @alwayspaws

    I can’t locate where those settings are to delete, rename or to add the products I want.

    You can use the Storefront Homepage Control plugin to remove those. You’ll find some information, as well as the download link for that here:

    https://woocommerce.com/document/homepage-control/

    Cheers!

    Thread Starter alwayspaws

    (@alwayspaws)

    @rynald0s I’m looking at it now.

    Thank you!

    Thread Starter alwayspaws

    (@alwayspaws)

    @rynald0s The plug-in says it hasn’t been tested with my version of WordPress and hasn’t been updated in two years.

    Is it possible to use it to fix my homepage and then delete the plug-in?

    I’ll have to try this later if that’s the case because I have to back up my website first.

    • This reply was modified 2 years, 8 months ago by alwayspaws.
    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @alwayspaws.

    Actually, please disregard my previous message. The Homepage Control doesn’t seem to work anymore. My apologies.

    You should be able to remove those by editing your page, here:

    https://snipboard.io/47nmlR.jpg

    You can do that for each category you don’t want. Have you given that a go?

    Cheers!

    • This reply was modified 2 years, 8 months ago by Rynald0s.
    Thread Starter alwayspaws

    (@alwayspaws)

    Hi @rynald0s

    I’ll try the new suggestion and will let you know if it worked for me. Good thing I was out walking my dog. ??

    Cheers!

    Thread Starter alwayspaws

    (@alwayspaws)

    @rynald0s When I open my homepage from pages to edit it, none of those sections show.

    When I go to edit the individual product to see if there are extra settings, there aren’t any:

    https://alwayspaws.com/shop/animal-art-prints-and-gifts/animal-lovers-gifts-animal-art-prints-and-gifts/costumed-tan-plush-puppy-wearing-pink-hoodie-dog-lovers-key-chain/

    Thread Starter alwayspaws

    (@alwayspaws)

    I tried to use https://snipboard.io/
    I’m on a Mac desktop.
    Do I hold down all of these at the same time? I keep trying. Nothing happens when I go back to the screenshot page.

    Press Shift + Ctrl + Cmd + 3.

    Thread Starter alwayspaws

    (@alwayspaws)

    @rynald0s
    I created a page to add my screenshots to:

    https://alwayspaws.com/home-page-want-to-delete-extra-sections/

    Ignore the shop by category! That one I’m keeping.

    Thread Starter alwayspaws

    (@alwayspaws)

    @rynald0s

    To confirm, I don’t see any categories with the names:

    new in, we recommend, best sellers, fan favorites.

    I also don’t have anything on sale, or cross-promoted, etc.

    Thank you. Maybe someone else has an idea? ??

    Hi there,

    Thanks for getting back to us.

    We can remove these sections from the home page by using the following PHP code. You can add this code in your child theme functions.php file. Please check the following documentation for setting up the child theme:

    https://woocommerce.com/document/set-up-and-use-a-child-theme/

    function remove_storefront_home_sections( $args ) {
        remove_action( 'homepage', 'storefront_product_categories', 20 );
        remove_action( 'homepage', 'storefront_featured_products', 40 );
        remove_action( 'homepage', 'storefront_popular_products', 50 );
        remove_action( 'homepage', 'storefront_on_sale_products', 60 );
        remove_action( 'homepage', 'storefront_best_selling_products', 70 );
    }
    add_action( 'after_setup_theme', 'remove_storefront_home_sections' );

    Let me know how it goes!

    Best,

    Thread Starter alwayspaws

    (@alwayspaws)

    Hi, @daniyalahmedk

    I already have a child theme and found the file. Should I use a plain text editor? I used to use Sublime a couple of years ago. It may take a minute because I have to go out.

    I added the screenshot for my child theme to

    https://alwayspaws.com/home-page-want-to-delete-extra-sections/?preview_id=2586&preview_nonce=019a65a1be&preview=true

    Thank you!

    • This reply was modified 2 years, 8 months ago by alwayspaws.
    • This reply was modified 2 years, 8 months ago by alwayspaws.
    • This reply was modified 2 years, 8 months ago by alwayspaws. Reason: additional info
    Thread Starter alwayspaws

    (@alwayspaws)

    @daniyalahmedk I made a backup copy and another copy, which I edited.

    Is this correct, before I edit the original child theme functions.php file? This is the entire file contents except that I removed the storefront_product_categories because I need that one. I selected “CODE” from this post editor but it didn’t put it in a box like yours did.

    `<?php
    add_action( ‘wp_enqueue_scripts’, ‘storefront_child_enqueue_styles’ );
    function storefront_child_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    ?>function remove_storefront_home_sections( $args ) {
    remove_action( ‘homepage’, ‘storefront_featured_products’, 40 );
    remove_action( ‘homepage’, ‘storefront_popular_products’, 50 );
    remove_action( ‘homepage’, ‘storefront_on_sale_products’, 60 );
    remove_action( ‘homepage’, ‘storefront_best_selling_products’, 70 );
    }
    add_action( ‘after_setup_theme’, ‘remove_storefront_home_sections’ );

    • This reply was modified 2 years, 8 months ago by alwayspaws. Reason: more info

    Hi there,

    Thanks for getting back to us.

    You can use the following code instead:

    <?php
    add_action( 'wp_enqueue_scripts', 'storefront_child_enqueue_styles' );
    function storefront_child_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    function remove_storefront_home_sections( $args ) {
    remove_action( 'homepage', 'storefront_featured_products', 40 );
    remove_action( 'homepage', 'storefront_popular_products', 50 );
    remove_action( 'homepage', 'storefront_on_sale_products', 60 );
    remove_action( 'homepage', 'storefront_best_selling_products', 70 );
    }
    add_action( 'after_setup_theme', 'remove_storefront_home_sections' );

    Let me know how it goes!

    Best,

    Thread Starter alwayspaws

    (@alwayspaws)

    @daniyalahmedk I promise to do this soon. Thank you.

    Thread Starter alwayspaws

    (@alwayspaws)

    @daniyalahmedk
    Hi,

    I updated the PHP code to child theme functions.php file with your exact code and it got rid of all the sections I didn’t want, except one I didn’t give you the name of: New In

    I tried to add the code but the New In section is still there.

    Screenshot: https://alwayspaws.com/home-page-want-to-delete-extra-sections/ or just please see: https://alwayspaws.com/ I still want to keep “Shop by Category”.

    I tried two ways:

    First:

    remove_action( ‘homepage’, ‘storefront_new_in_products’, 80 );

    and then:

    remove_action( ‘homepage’, ‘storefront_new_in_products’, 30 );

    Please let me know what I did wrong. Thank you for the terrific help!

    Here is the entire code as it is now:

    <?php
    add_action( 'wp_enqueue_scripts', 'storefront_child_enqueue_styles' );
    function storefront_child_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    function remove_storefront_home_sections( $args ) {
    remove_action( 'homepage', 'storefront_new_in_products', 30 );
    remove_action( 'homepage', 'storefront_featured_products', 40 );
    remove_action( 'homepage', 'storefront_popular_products', 50 );
    remove_action( 'homepage', 'storefront_on_sale_products', 60 );
    remove_action( 'homepage', 'storefront_best_selling_products', 70 );
    }
    add_action( 'after_setup_theme', 'remove_storefront_home_sections' );
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Extra Unwanted product-related sections on homepage’ is closed to new replies.