is_shop()
is returning false because the WordPress query isn’t set up yet when functions.php
is run. If you attach it to a hook, like wp_loaded
, it should work.
add_action( 'wp_loaded', 'remove_main_content' );
function remove_main_content() {
if( is_shop() ) {
remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
}
}
Related Posts:
- how to get woocommerce product attribute slug
- How to display product price of the product in loop
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- How do I add a text input field for customers to leave a note on a single WooCommerce product page?
- Get Woocommerce Subscription Product
- WooCommerce pages accessible to logged in members only
- Auto update cart after quantity change
- paypal not showing on woocommerce payments
- Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image
- Save and display selected product option and cost as cart item data in WooCommerce
- How to remove product base from WooCommerce product permalinks
- woocommerce image product add a class and data-src attributes
- Woo create order only after payment done
- Change Category Widget Dropdown List Select Name
- wooCommerce checkout page State / County (optional) validate not working
- Remove the link from the thumbnail and product title on woocommerce
- WooCommerce – Multiple meta query not working
- woocommerce_package_rates not fired everytime
- how to change woocommerce shop archive description? [closed]
- How to display the result of a custom metabox in the frontend [closed]
- Quantity on the product card and subtotal disappear [closed]
- Admin access for custom user capabilities
- Display product category taxonomy terms in WooCommerce shop loop
- how to show store name when I add a product on cart in woocommerce(woocommerce multi store)?
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Woocommerce Moving Review Below add to cart breaks button
- WP All Import manual Cron
- Create archive page for woocommerce attribute
- Refund from wooCommerce with stripe [closed]
- Download permission for non-purchased products
- Display FREE for $0 products in woocommerce ++++ [closed]
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- Have I got this IF Statement correct?
- Setting an attribute as variation in woo commerce via php [duplicate]
- WooCommerce – Conditionally enable shipping for virtual products
- WooCommerce Price Filter not working? [closed]
- How to remove unwanted text bug in wordpress site
- get woocommerce product image url and price from database [closed]
- Trying to style Woocommerce sidebar Cart Widget [closed]
- Cancelled orders move to Trash automatically in Woocommerce – how to disable?
- Adding Field in WooCommerce
- Woocommerce Sort by default variation price
- Add Name and SKU Main Product to Secondary Product to Cart
- How can i access woocommerce order variables inside shortcode?
- Conditional logic – if product has a parent category, echo this
- WooCommerce set default product sort to product description (content) [closed]
- WooCommerce – Split Multiple Items into Individual Line Items
- Change “Select Options” label in button to “Buy Now!” in store page
- Woocommerce purchase date [closed]
- How to add a special Woocommerce “buy now” button?
- Woocommerce: Any way to list all products *without* a specific attribute?
- Woocommerce product import exports product with price rounded to integer? [closed]
- How to hook to function of woocommerce product export _regular_price?
- Filter by Price filter button not working
- porto theme pagination on woocommerce not working
- Adding preference buttons to main nav that persist via user sessions. (Woocommerce)
- Woocommerce custom log in and register
- Urgent Validate Save-Post Hooks on Woo-commerce product entry form!
- Is doing a database query in Woocommerce efficient to only display posts from a certain category?
- Call product search from custom hook
- CallBack URL for payment gateway redirecting to homepage instead of executing callback function
- Display when items are in Woocommerce cart but hide when empty
- Printing product variation return array to string conversion error
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- How to get cookie value?
- Woocommerce Disabling Auto Restocking for Cancelled Orders
- Custom pagination permalink structure Product page
- Woocommerce modifying the html on the checkout page?
- Pseudo class :before don’t working in a specific button
- How to speed up “My Account > Orders Page” on Site with More than 200,000 orders?
- Editing product categories suddenly crashes website and goes back to wordpress installation
- ACF in WooCommerce mail template
- WooCommerce product details page category display
- Woocommerce – Default product image by user role
- WooCommerce product id as permalink
- Merge “description” and “additional informations” product tab
- I need to refresh the checkout page if someone changes the zip code
- WooCommerce does not translate every string
- Woocommerce add a text field if specific option is selected
- Add suffix to price html does not work
- Get user active posts randomly
- add_filter not works in ajax
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- How Fragile Is DB if I Upload Completely Updated Files
- Broken 302 redirection for product subcategory (Woocommerce, Apache)
- Website Tablet Check Out Field Issue
- WooCommerce order created via REST – sending the date_created along
- How to allow registration only from a certain location?
- Add confirmation popup on place order button
- Get Third Level Categories WooCommerce
- Change wp-login.php? Problem with .htaccess password protection and multi user shop
- Conditional email recipient based off Shipping Method [closed]
- Change WooCommerce Checkout Button – Reverts to normal
- Show pop up message for specific categoryies
- How to remove content from hacked pages? [closed]
- Disable WooCommerce Address State Dropdown
- How to show detailed order history on woocommerce product page [closed]
- Critical error on woocommerce checkout page
- Can’t add variable products since update WooCommerce [closed]