Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
10 views

Check if there are posts with specific ACF field value in current archive query posts

I developed a custom ACF field archive filter which lets you filter posts with ACF fields - similar to Woocommerce product attribute filters. It loops thru all fields in a field group and echos all ...
0
votes
0answers
16 views

List of product attribute values [on hold]

I've variable products and would like to list all the values of specific product attribute (Texture) in single page. Product can have even 50+ textures and it's impossible to select from them on ...
1
vote
1answer
39 views

Display a selected custom product option in WooCommerce cart

I am using the code below to display a custom select field on WooCommerce single product pages: <?php $sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?> <?php ...
-1
votes
1answer
24 views

How to remove product attribute row woocommerce using code

I am trying to remove an attribute row in a product attribute tab using code. Woocommerce uses javascript to hide attribute row then uses ajax to save changes. I need this row to be disappeared and ...
0
votes
0answers
36 views

a weird attribute on every html tag

me and my friend working on a Wordpress site but we see it differently on our machines, He sees a weird attribute wfd-id="" on every html tag in google console when he inspect it, also I loaded ...
0
votes
0answers
18 views

How to add particular attribute of product in shop as well as home page

How to add particular attribute of product in shop as well as in homepage
0
votes
0answers
10 views

Woocommerce Category Attribute

I am working on a wordpress project with woocommerce. I am new to woocommerce and i need for my client to create some personalization of the admin panel, in order to make the website customization as ...
0
votes
0answers
32 views

Add attribute to existing Shortcode

I have an existing shortcode (from a plugin) and I would like to add a new attribute or parameter to this shortcode. The shortcode looks like this: [my_shortcode_from_plugin_xyz posts="5" autoplay="...
0
votes
2answers
57 views

Img alt tag showing different value then entered

I have a WordPress website "https://drgadyabramson.com" I am optimizing the website for better ranking. But the problem is Yoast SEO showing me that "The images on this page do not have alt attributes ...
0
votes
1answer
43 views

Block properties, attributes and settings

Reading the Gutenberg Handbook about the new Block architecture in WordPress, I've come across references to "properties", "attributes" and "settings" for the blocks. As there's a lot to read, I've ...
0
votes
0answers
33 views

How can I add attributes to paginate_links?

I'm trying to add a custom attributes to my paginate_links for my blog page. Is this possible? Here's what I'm currently using: echo paginate_links( array( 'base' => str_replace( $big, '%#%'...
0
votes
0answers
22 views

index page link tag injected with wrong href attribute

Recently when I've updated my wordpress site to the latest version, the website has become incredibly slow because stalling occurs when trying to load a corrupt href link: the href attribute should ...
0
votes
0answers
73 views

How to extend gutenberg page attributes?

How can I add an extra option under page attributes in Gutenberg editor? I would like to have a radio to show, hide page title
0
votes
0answers
5 views

Create attribute values based on filesystem contents

I'd like to create a new attribute called "Font" and have the values be based on whatever .ttf files are in a directory. For example, if Abbey.ttf Arial.ttf TimesNewRoman.ttf the dropdown would ...
0
votes
0answers
64 views

Woocommerce dependent attributes

I'd like to add a product attribute which is dependent on another product attribute. For example: Material: Wood | Plastic | Leather Color: <different values for wood, plastic, and leather> ...
0
votes
0answers
9 views

WooCommerce Attributes Hierachy and Output

After a few weeks of trying to find a good solution to create a Make & Model Relationship, Toolset was used, didn't work. Created 2 Custom Taxonomy with Pods, 1 called Make & 1 called Model. ...
0
votes
0answers
16 views

Title attributes on Permalinks for posts and products

I need to add title attributes to my wordpress links for new posts, pages and products on a website. This is for the actual post/page/product and not within content. For example if I create a post/...
1
vote
2answers
30 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
57 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
148 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
2answers
1k 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 ...
1
vote
0answers
82 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
250 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
26 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
32 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 ...
7
votes
2answers
2k 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
94 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
108 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 ...
1
vote
1answer
4k 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
545 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
723 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
41 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
564 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
16 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
11 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
2k 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
291 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
351 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
235 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, ...
2
votes
1answer
1k 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
65 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 ...
1
vote
2answers
755 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
181 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
534 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
79 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 ...
1
vote
1answer
54 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
132 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
46 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
1answer
100 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
133 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 ...