• Resolved bartosz.kozak

    (@bartoszkozak)


    Hello,

    How can i add the description/”html” text on the only main shop page?

    So if the url is xyz.com/shop/ only (not category, not pagination), under the products should be the text showed?

Viewing 1 replies (of 1 total)
  • Hi @bartoszkozak,

    How can i add the description/”html” text on the only main shop page? So if the url is xyz.com/shop/ only (not category, not pagination), under the products should be the text showed?

    From what I understand, you’re looking to add a description or HTML text to your main shop page, specifically under the products, and only for the URL xyz.com/shop/.

    To achieve this, you can use a code snippet that hooks into the ‘woocommerce_after_main_content’ action. This action will trigger after the main content of each page, allowing you to add your own custom content.

    Here is the code snippet you can use:

    add_action( 'woocommerce_after_main_content', 'wc_custom_shop_page_content', 10 );
    function wc_custom_shop_page_content() {
    if ( is_shop() ) {
    echo 'Your description or HTML here';
    }
    }

    Just replace ‘Your description or HTML here’ with your actual content or HTML. This code snippet will add the description or HTML only on the main shop page, not on category or pagination pages.

    Here’s an image for your reference:

    Image Link: https://s5.gifyu.com/images/SRvt9.gif

    You should add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, like the Code Snippets plugin. Please note that it’s not advisable to add custom code directly to your parent theme’s functions.php file. Doing so could lead to the code being erased when the theme is updated.

    ?? Just a quick reminder: Before you make any changes, we strongly recommend that you create a backup of your full site and database. This is a crucial step to ensure that in case anything goes wrong, you can easily restore your site to its previous, functioning state.

    If you want to add the description at a different location, could you please provide a screenshot indicating where you’d like to add it? This would help us to provide a more accurate solution. You can use https://snipboard.io to share screenshots. Just follow the instructions on the page and paste the URL in your reply.

    Please let me know if you have any further questions or if there’s anything else I can assist you with.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding description on main shop page’ is closed to new replies.