Show category Title before list grid in category page

This topic has 5 replies, 2 voices, and was last updated 2 years, 6 months ago ago by Julien

  • Avatar: Julien
    Julien
    Participant
    September 27, 2021 at 12:10

    Hi,
    I want to show the category title before the list grid at to top of the page but near the sidebar
    And i want to keep the breadcrumb too
    How can i do this ??
    (show my example screenshot wanted result )
    https://prnt.sc/1ttg3da
    Thank you

    4 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 27, 2021 at 15:17

    Hello,

    You can use category description to add the necessary content in that area (title in your case). So, go to Theme Options > WooCommerce > Shop > Shop page layout > Shop Page Banner Position > choose at the top of the page. After that go to Products > Categories > edit product category and add the title to the product category description field.

    Regards

    Avatar: Julien
    Julien
    Participant
    September 27, 2021 at 15:56

    Yes I saw this solution but it’s not okay. We have 300 categories, we have to do it one by one, it’s not the best.
    We cannot insert it in the code just before the description ? if so on which file on which line i can do this. Thank you

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 27, 2021 at 18:00

    Hello,

    You can use WooCommerce hooks to add titles by additional customization. For example, add the below code to child theme functions.php

    add_action('woocommerce_archive_description', 'category_title_custom');
    function category_title_custom() {
    //show category title
    $term_object = get_queried_object();
    ?>
    <div class="woocommerce-category-description">
        <div class="title"><?php echo $term_object->name; ?></div>
    </div>
    <?php
    }

    Regards

    Avatar: Julien
    Julien
    Participant
    September 30, 2021 at 14:02

    Merci ! ça fonctionne

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘Show category Title before list grid in category page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.