Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [attribute]

The tag has no usage guidance.

1
vote
2answers
16 views

How to get all `supports` attributes by post type?

i.e. when post is registered, like this: $args= [ 'supports' => ['thumbnail', 'title', 'post-formats' ...] ] If later, I want to get all supports attribute for specific post type, which ...
0
votes
0answers
14 views

How to add product variations for large number of products in WooCommerce?

I have a Wordpress site with WooCommerce selling photo prints. Currently there are around 150 photos. I managed to import the photos as products fine, but each print has 3 sizes. I've added a Size ...
0
votes
0answers
24 views

WooCommerce: how to set stock per attribute on variable product

So I have a variable product with the attributes "time" and "package". Time has 3 options: "1 week", "2 weeks", "3 weeks" Package has 2: "Full ticket" and "half ticket" This creates 6 variations. ...
0
votes
1answer
83 views

Remove “Choose An Option” on Product Variation & Auto Select Instead

I have a specific dropdown field on variable products on my WooCommerce site that only ever has one option available. Example: the customer chooses the item “type”, then “color”, and finally “part ...
0
votes
0answers
13 views

Variations Stock Not working for second variation

I have couple rings on my site , and must choose one for men and one from women the problem is when customer placing order the stock of women is decreasing from stock but men always not change the ...
1
vote
0answers
15 views

Can't create term for product attribute

Please help. I need to create product attribute term after I create a product attribute taxonomy. wc_create_attribute([ 'name' => 'Size', 'slug' => 'size' ]); // This will only work If I ...
0
votes
1answer
32 views

Is is possible to merge pa-color attributes?

Wrongly I created two black attribute for all products. now black color products increases on two different black color attributes with different IDs the problem is Im using ajax products filter for ...
0
votes
1answer
25 views

Add attribute only to first image of every post via functions.php

I would like to use a simple function in order to add a specific attribute (lets call it “example”) to the first image of every blog post, so that I don't have to do it manually in thousands of posts. ...
0
votes
1answer
20 views

Convert attribute woocommerce terms (taxonomy terms) in posts of custom post type

NEED I have a list of terms of attributes in woocommerce, specifically WRITERS: list of writers name. I want to convert writers name in posts of a custom post type, WRITERS. The terms of attribute ...
6
votes
2answers
258 views

How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)

I am upgrading Font Awesome 4 to version 5 which introduces both integrity and crossorigin attributes to the <link rel="stylesheet"> markup. Currently, I am using: wp_register_style('...
0
votes
0answers
33 views

Customize Sizes Attribute for Default Image Sizes (Medium, Large)

I'm trying to modify the default 'sizes' attribute for images placed in content using the default WP sizes (e.g., Medium or Large). These are images generally placed in the body of a page/post with ...
0
votes
1answer
16 views

Extract links from content

I'm looking for a solution to only display the links inside a string (my wysiwyg content) on my single page. First of all extract all my links, and replace each links content by the links title ...
0
votes
1answer
416 views

How to get all attributes with their terms related to specific Woocommerce product category [closed]

As we know, to get terms of specific attribute added to a product we can use: $attr_terms = $product->get_attribute( 'attr_slug' ); OR to get all terms of specific attribute regardless of a ...
0
votes
1answer
50 views

Woocommerce image variation not changing

I have Design and size variations of a product and have uploaded the various images accordingly. On the front end, the images are swapping when the user selects different Design and size. The ...
0
votes
1answer
84 views

WooCommerce Simple Product Options List

My client's website will be selling jewelry. Mostly one of a kind rings. So once a ring is purchased, it's no longer available for sale. The rings are available in a range of sizes. The size selected ...
0
votes
0answers
11 views

How do I add a hover image for the product attribute?

I have a website selling products with colour variations. I have added these different colours as images so the customer's can better see the colour of the actual item. As these are just small ...
0
votes
0answers
27 views

Woocommerce add attribute type(Text,Radio)

Woocommerce has only attribute type select, now i want to add more types like textbox, radio, so front user type text and change radio options as per his choice. Thanks in advance.
0
votes
0answers
327 views

Showing Woocommerce variation data in select options

I am a little stumped on the right way of how to show variation data of a product in the options field that have been restyled into toggle boxes. I want to show data as such: variation name ...
0
votes
0answers
8 views

Support MagnificPopup for posts images

MagnificPopup requires the parent of the image to be a tag with href attribute contains the image link. After searching I found that the problem can be solved by add data-mfp-src attribute directly ...
0
votes
0answers
54 views

How to hide attribute options on related product

I have products with many color attributes and when the related products widget loads at the bottom of the product page. It shows every possibility and does not look very good. Is there an option to ...
0
votes
0answers
10 views

woocommerce attributes error content

i have create attributes Size (slug = size) and list Configure terms as: L(slug = l), M(slug = m), S(slug = s) i'm visit follow url: domain.com/size/l or domain.com/size/m or domain.com/size/l is ...
1
vote
0answers
1k views

Get product variation attribute titles - WooCommerce

Hi there so when I am on a product page and I loop through the variations, I want to list their attributes WITH their titles. I have my code at a point which lists the variations attribute values but ...
1
vote
0answers
120 views

How to change Attribute Type

I have created an attribute product-pv like below. Using the following code, function proccess_add_attribute($attribute){ global $wpdb; //check_admin_referer( 'woocommerce-add-new_attribute' ); if (...
0
votes
1answer
58 views

Woocomerce - Order products by float attribute in archive pages

I'm trying to order the products in the frontend by a float attribute (pa_od), I have this code but the order is incorrect add_action( 'woocommerce_product_query', 'imcar_custom_product_query' ); ...
0
votes
0answers
153 views

How to save taxonomy attribute values to variations on a variable woocommerce productorrect variation values on a variation of a variable product

Linking taxonomy attribute values to variations on a variable woocommerce product Hello, I'm struggling with creating variations on a variable woocommerce product. I'm able to create the variations, ...
0
votes
0answers
75 views

Displaying woocommerce product attribute

There is a single product page template. And inside there it display all the product details (title, price, attributes, .etc) under this "do_action" code : <?php ...
2
votes
0answers
890 views

Woocommerce add to simple product attribute programmatically

i want to create a function which will add to specific products an attribute programmatically. i use the below code but it doesnt seem to work. $attributedata = Array( 'pa_color'=>Array( ...
1
vote
1answer
54 views

Get ALT attribute from title post (code not work)

I 've found the following code to fill the ALT attribute everytime I upload and image in Wordpress. The code gets the name of the image to fill the attributes, but I want he gets the title post, how ...
0
votes
0answers
36 views

Add attribute to product with code

I try to create a function that will add a specific attribute to selected products. the code i have for now is the below $attributedata = Array( 'pa_color'=>Array( 'name'=>'...
1
vote
2answers
373 views

Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?

I'm looking to mass remove or clear the default attribute for variable products in Woocommerce. Is there an easy way to mass clear this value? If not, would you be able to direct me on where I can ...
0
votes
1answer
98 views

WooCommerce: One term for Many Product Attributes

I am using WooCommerce Product Attributes to show mobile phones specifications. For that I have created woocommerce product attributes like OS, Resolution, Color, Weight, Has Fingerprint, Has Dual ...
1
vote
0answers
368 views

Save custom attributes of product in woocommerce

I have some custom attributes for each product in woocommerce, I can edit them at the Attributes tab. I can also read them using this code $product = new WC_Product($product_id); $v = $product->...
0
votes
1answer
44 views

How to process a single attribute in a SQL request twice times?

I have created a shortcode with only ONE attribute, but the SQL request needs TWO attributes for %s, because of the subquery. The following SQL does not work, because the second %s does not have a ...
0
votes
0answers
26 views

Parameters are get added repeatedly to url on every Form submit in same page while using GET method

On using GET method in form, on everytime form submits parameters are repeatedly added to the URL. Eg: http://demo.com/product-category/demo/?filter=1&param1=&param2=&filter=1&param1=&...
0
votes
0answers
250 views

How to get WC product attribute from custom plugin?

I'm working on a custom plugin, I get some information from DB using queries, but I didn't find some product attributes (as sku, description, price, stock etc) in database. There is a way to get this ...
1
vote
1answer
35 views

Calling an attribute from a plugin shortcode

I'm using this plugin to show the reading time of my post: https://jasonyingling.me/reading-time-wp/ However, I have modified some stuff because I want to be able to use it with different languages ...
0
votes
0answers
84 views

Woocommerce - display logo attribute in archives page

I insert logo url to attribute. I would like display this imae on archive page for each product. Can you help me? Thanks a lot. Best regards.
0
votes
0answers
71 views

shortcode atts not working

I created a shortcode with attributes that modifies the query with the following code: function LoopShortcodeAtts($atts) { ?> <?php get_template_part( 'shortcode/shrt_loop_con_atts' ) ?...
0
votes
1answer
33 views

Wordpress function with attribute pass to template

really new to this stuff. I basicly want to create a shortcode with an attribute that calls the function "playlist_code" which inserts a template with that attribute. This is my code so far, I cant ...
0
votes
0answers
407 views

Woocommerce add attribute programmatically, pagination not working

I have added woocommerce attribute programmatically in Attributes and Single Product Attributes. This is done with a hook when product is saved. I have enabled attributes to have archive pages. The ...
0
votes
1answer
78 views

Call Shortcode Attribute Value within another function

Please anyone with an idea of how I can extract some values of this shortcode attributes and use it within another function. How the code looks like: function myVal($attr, $content = null) { ...
0
votes
1answer
107 views

shortcode - multiple instances of same parameter name in one shortcode instance

I'm looking to include a shortcode that builds a table of items and groups of items. For this I wish to be able to include an attribute multiple times or chain them together in some way. An example ...
0
votes
1answer
122 views

Jquery wrap permalink in a data-attribute?

I'm calling the permalink of post on submitting a form like below: var $this = $(this), category = $this.attr('data-event-category'), action = $this.attr('data-event-...
-1
votes
2answers
1k views

Alt attribute is not showing while the value is given in Media

Here is my website http://www.taramesh.ae/ I'm trying to perform SEO on it and for this I need to set alt attribute for each image. Even I have given it in media but instead, it is not showing when I ...
0
votes
1answer
1k views

Woocommerce Product Attribute Permalink doesn't work?

Normally, I can filter product by attribute via calling "mysite.com/shop/?filter_brand=tesla" However, when I tried to call it as "mysite.com/brand/tesla" but it doesn't work and show 404 not found. ...
0
votes
1answer
545 views

Importing Attributes in to Woocommerce

I have a text file with 100 + names, I need to import this as an attribute into WooCommerce. I’ve been searching all over for an answer but can’t figure it out. I've tried some plugins but they don't ...
0
votes
0answers
25 views

Second attribute of shortcode is not changing why?

I have made a heading attribute I which my title attribute is changing but my data-a attribute is not why is it happening. Here is the shortcode : [test title="cus" data-a="safsaf"][/test] and here ...
0
votes
1answer
734 views

WooCommerce Variation Swatches and Photos - get attribute thumbnail

I am using the plugin WooCommerce Variation Swatches and Photos which lets me add a thumbnail to my product's attributes. I need to list all the attributes on a template and I would like to also get ...
0
votes
1answer
230 views

Replace image attributes for lazyload plugin on image elements with specific class

I want to apply lazy load to only certain images. I found here ( Replace image attributes for lazyload plugin (data-src) ) a way to create the data-src attributes and replace the src attribute with ...
0
votes
1answer
1k views

Add attribute taxonomy through code don't appear in admin product page

I've inserted the attribute manually after inserting new products through code: $attributes = Array( "type_product1" => $data1, "type_product2" =&...