If i understand you correctly here you want to display some text under each of the category titles on your shop page. Instead of editing the template i would suggest using a hook. To do this you should move your code into functions.php.
The complete code would look something like this:
add_action('woocommerce_after_subcategory_title', 'wpse_add_custom_text_under_category_title', 10);
function wpse_add_custom_text_under_category_title($category) {
$term_id = 'product_cat_'.$category->term_id;
the_field('krotki_opis_kategorii', $term_id);
}
The reason why your code is not working is because when you run get_queried_object_id on the shop page it will return the id of the page and not the category. When you use the hook, the $category object will be passed in through the hook like in the code above.
Hope this was what you were looking for. I did not test this code but it should work.
Related Posts:
- The values of custom fields are not available functions.php
- Set ACF on order during checkout
- Get field value and use as variable in php
- Place product field value as variable in php
- WooCommerce Custom Tab with ACF Repeater Field
- Order woo products, but first products must be with acf fields
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Show button in header when product custom field is not empty
- Remove Woocommerce product link
- Display sorting options dropdown when using WooCommerce product category shortcode
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- Using Cookie Data For WP_Query Loop
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- ACF check if variable has http, if else return string
- How to prevent those PHP variables from being cached on WordPress?
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- How do you add customer capability after Woocommerce purchase?
- Change sign up fee in cart for subscription products WooCommerce
- Make the first item as default on Woocommerce product category items list
- dividing sub-categories by parent category – WordPress
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- How to get all shipping rates and costs without session in woocommerce?
- Display a specific category of products in shop page and disable code for specific actions
- Trying to build simple deposit code that hooks into woocommerce
- how to fix error “called incorrectly, should not be accessed directly”?
- How to auto fetch customer details in Woocommerce in checkout page
- How to use thumbnail size of image if I’m only using src to get image
- I want to add custom add to cart link [closed]
- Validation algorithm in checkout field
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Advanced Custom Fields – display label and value only if value entered
- How to remove coupon dropdown feature
- Add html link in functions.php files of the theme
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Seo Friendly Filter URLs
- Remove page title in product page using a function
- woocommerce specific quantities for product
- how can i add class or span tag at sprintf?
- Display attribute on shop page after the title
- WooCommerce – Moving Product Price to the Left of Add to Cart Button [closed]
- Refactoring long if/else php chains
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Have Woocommerce show product price if id, when not logged in
- Update post meta – Custom field does not match meta-key
- Custom reduce stock code affecting date_modified – How to bypass?
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity
- WooCommerce Query Product Titles
- ACF: Display Google Map in frontend issues
- How to add a shortcode which runs a .php file for the current post
- Variant Item SKU as Product Code
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- How can I change the background color of divs dynamically (depending on an order-status in woocommerce)?
- Add a new view on the Woocommerce account page
- Use Search Term in html link and redirect
- How to get content on a blank basket/cart page in a custom theme with woocommerce
- ACF relationship on user profile page used for allowed access
- WooCommerce REST API AJAX Auth – 401 response
- Looping through and combining calls to Woocommerce REST API
- How to import woocommerce custom fields data into another site?
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- Adding product permalink on admin order page throwing error
- How to override WooCommerce Order Item Meta with data from Cart?
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- Add custom attribute to product’s HTML to woocommerce cart page
- Change WooCommerce template for PDF – access to custom field
- How can i style “echo apply_filters”
- Get all woocommerce product names with price and show using core php
- Add custom ID attribute to all woocommerce products on archive pages
- How to properly create multiple conditions to redirect users roles to different pages
- Ordering / grouping posts by datepicker ACF
- How can i put php code on the wordpress page?
- How to detect if a revision was made by woocommerce or wordpress?
- How do I prevent a folder from reappearing in my home directory?
- jQuery doesn’t work in my php snippet
- Use WP_Query Data In Cookie
- Sort by multiple options in custom field
- If or/and statement advanced custom fields [closed]
- Top menu disapears in Category Pages when filtering using ACF
- How to add custom checkout field in user details mail template
- Add specific phrase after every product title including the discounted price? [closed]
- Display Sale Price Before Regular Price (WooCommerce)
- Setting WooCommerce currency programmatically
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- How to create a container in php then customise it in CSS
- WCFM Custom form
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Removing the add to cart button from specific product pages
- Add Woocommerce Customers link to custom admin menu
- PayPal button not showing and cannot retrieve order error in PayPal
- Add text below WooCommerce short description if metabox value is true
- ACF number less than comparison not working
- Woocomerce custom add to cart button edit functionality [closed]
- Assembly Options at checkout
- Put ACF function output code the_terms
- How to get default variation ID (woocommerce)
- Date not working correctly