admin管理员组

文章数量:1122846

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 3 months ago.

Improve this question

I own and run a gaming website. The games are listed in a WooCommerce catalogue (this was set up prior to my acquisition of it).

Whenever the games catalogue page is loaded, the title "Shop" is shown at the top.

I want to remove the title altogether as it isn't actually a shop.

The page can't be edited (as it is generated via the WooCommerce plugin) and there is no option in the WooCommerce settings to either remove or even change it to something else.

I've spent perhaps two hours trying to remove the word "Shop" from the page using a variety of PHP and CSS methods I have read about online for people with similar problem but with no luck.

How can it be done?

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 3 months ago.

Improve this question

I own and run a gaming website. The games are listed in a WooCommerce catalogue (this was set up prior to my acquisition of it).

Whenever the games catalogue page is loaded, the title "Shop" is shown at the top.

I want to remove the title altogether as it isn't actually a shop.

The page can't be edited (as it is generated via the WooCommerce plugin) and there is no option in the WooCommerce settings to either remove or even change it to something else.

I've spent perhaps two hours trying to remove the word "Shop" from the page using a variety of PHP and CSS methods I have read about online for people with similar problem but with no luck.

How can it be done?

Share Improve this question edited Sep 28, 2024 at 23:07 Mus asked Sep 28, 2024 at 23:01 MusMus 1195 bronze badges 2
  • If you have the ability to edit the theme, if it's a CHILD theme, you can manually edit the template for archive_products.php and then place the edited version in your child theme which will override the WooCommerce template. You also can do it with CSS, but I'd need to see the page to show you the rule. – Tony Djukic Commented Sep 30, 2024 at 20:25
  • @TonyDjukic. The closest I could find is archive.php. The page in question is cloudgamingcatalogue.com/cloud-gaming-catalogue. Thank you. – Mus Commented Oct 2, 2024 at 12:16
Add a comment  | 

1 Answer 1

Reset to default 1

CSS METHOD

To hide with CSS this should do the trick for you. Add the following to the theme's or child theme's style.css, or to the Customizer's CSS section:

body.post-type-archive-product .bs-card-box.page-entry-title {
    display: none;
}

What we're doing here is targeting the product archive template file that WooCommerce uses to dynamically create that page. By doing this we avoid hiding the title on other pages. The specification comes from body.post-s-type-archive-product.

Then we locate the container on the page that has the title, which is .bs-card-box.page-entry-title and we set the display to display: none;.

That should take care of it for you.

THEME/TEMPLATE METHOD

Now, the way to do it by editing it in WooCommerce is as follows.

You want to locate, in the parent theme a file called archive-product.php. It'll probably be located in wp-content/themes/your-theme-directory/woocommerce/archive-product.php.

If you copy that over to your child theme and match the path so it's:

wp-content/themes/your-child-theme-directory/woocommerce/archive-product.php

Then find where that mark-up and PHP is, something similar to this:

<div class="bs-card-box page-entry-title">
    <h1 class="entry-title title mb-0">SHOP</h1>
</div>

...then just comment out that code in your copy that you've put into your child theme.

Like this:

<!--<div class="bs-card-box page-entry-title">
    <h1 class="entry-title title mb-0">SHOP</h1>
</div> -->

Keep in mind that I'm kinda just guessing on what this will look like and guessing the location of this file, it'll most likely be different. However, the CSS method should be all that you need.

本文标签: phpIs it possible to remove the quotShopquot title from the WooCommerce catalogue