The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
28 views

Remove HTML content if attribute is not set / variable attributes

So I'm creating a shortcode that uses the standard bootstrap carousel. It works completely fine as long as all the 3 slide attributes are entered correctly but obviously if only 2 are set and the ...
0
votes
1answer
23 views

Add the title attribute to links

I want to add a title attribute to my link like this: <a href="#" title="here is the title">LINK</a> I know how to do this in html but I can't expect this from my users. I can't find ...
0
votes
0answers
13 views

Shortcode Attribute contains clone of all shortcode attributes

This is easily the strangest thing I have see wordpress perform. I have a shortcode, we'll call it my_foo . We'll say it has several attributes, bar_one, bar_two, bar_three . This shortcode is part ...
4
votes
1answer
36 views

How can I allow for multiple template views on the Gallery Settings page when using the Visual Editor?

I'm trying to extend this answer by making it possible to switch shortcode attributes from the UI and alter the gallery markup based on those attributes. [gallery owl="true" link="none" ...
-1
votes
1answer
93 views

language_attributes for two languages?

I'm looking for option to change language_attributes manually without hardcoding it like html lang="en-US" in html it self. The reason for this is I have three language site, using same WP engine ...
0
votes
1answer
15 views

WooCommerce Attribute Display Issues

am using WooCommerce for a website however I have an issue with the products attributes. I haven't seen this issue before, the attributes and variations have all been created however on the frontend ...
0
votes
2answers
49 views

Pass Shortcode Attribute to footer Script

i am trying to generate a wordpress shortcode which will display a (bx)slider. The shortcode function itself works like a charm, i can pass my data and the shortcode gets rendered well. The problem: ...
0
votes
1answer
47 views

Add data-id attribute to child page links

The should be simple but I just can't figure it out nor find an answer. I need to add a data-id attribute to the <li> parent container of the respective child page <a> links. The HTML is ...
0
votes
2answers
56 views

Get product details by url key in Wordpress woocommerce

I want to load products deatails on my custom page.Is there any way that i can use the url key like http://localhost/mysite/product/samsung-1.In this url samsung-1 is the key for that product.I want ...
0
votes
0answers
36 views

Add custom dynamic attributes to menu items

Hello I would like to add a data-hover attribute to each element in a specific Wordpress menu. I found the following on the codex. However I don't know how to call each specific nav item to have the ...
0
votes
1answer
37 views

Woocommerce: Any way to list all products *without* a specific attribute?

We're going back through an existing site and adding attributes to the products, but we need a way to verify that every product has gotten them. Is there any method or function call that will give ...
1
vote
1answer
259 views

How to set value/term of a Woocommerce attribute text field in admin panel?

I am developing a plugin which is supposed to auto-fill the attributes text field. There is a URL text field where user enters URL, on focus out I trigger a AJAX call through which I am able to save ...
0
votes
0answers
149 views

Delete all per-product attributes in WooCommerce

Is there a method to find & delete most/all attributes for products in WooCommerce when these attributes are unique to each product, that is they don't appear under the Product->Attributes menu? ...
2
votes
1answer
376 views

Adding HTML within an image title attribute

I am using some jquery which applies an overlay on an image on hover. The script uses content from the image's title attribute to display over the image. When I tested this locally, it seemed to work, ...
0
votes
0answers
38 views

Add custom attributes to the individual blog table in multisite

I am adding custom product attribute to a multisite network. Currently the added custom attributes save on the default WordPress database. I have to store the data in corresponding blog database table ...
0
votes
1answer
276 views

WooCommerce - Adding Product Attributes to CSV Export

I'm trying to customize the WooCommerce CSV Export plugin to add additional columns for two standard product attributes ("fund" and "appeal code"). I'm able to add the actual headers, but can't get ...
0
votes
0answers
104 views

TinyMCE editor for woocommerce product attribute

I am creating a custom product attribute by a use of a plugin, but there is a problem that it outputs a simple textarea. What I need is either a TinyMCE editor or some simple editor with a possibility ...
0
votes
1answer
85 views

Woocommerce Product attribute not imported with wordpress Importer [closed]

I used the WordPress Importer plugin and successfully imported all content but woocommerce product attributes are not imported. Tried a few different tests, and few different servers. Same result. ...
0
votes
1answer
64 views

Remove all link title attributes

After reading this and this, I want to remove the title attribute from all links of my blog, as that is good from accessibility point of view. How this can be achieved? UPDATE I found a solution how ...
-1
votes
1answer
243 views

I want to filter my products with attributes [closed]

I have ebook store, where all the books are listed, everything is done.. In products, publisher and author added as a custom attributes. Now I want to filter the products on the basis of ...
1
vote
1answer
84 views

How can I make all post image uploads have data-width and data-height attributes automatically by default?

Right now all my images automatically have width= and height= when someone adds an image to a blog post. But what if I also want every image to have a data-width= and data-height= and have it equal to ...
0
votes
0answers
34 views

how to manually change the loop to just show images and their attributes?

I want to change the behavior and styles of the Wordpress default image gallery. I mean, I don't want to just call the loop to show all images in a post/page gallery with default attributes and ...
-1
votes
2answers
57 views

Woocommerce linking variations

So I have this array (just taking an example, it's dynamically built up): $v_values = array( array("C1","C2"), array("F1","F2") ); $v_name = ...
0
votes
0answers
327 views

Woocommerce: custom product attribute sorting not working (backend)

I am having a problem sorting the product attributes in the backend. I have a product attribute called "size" which has numerical and string values (36, 37, 38 .. XS, S, M, L). Because they were not ...
2
votes
2answers
119 views

Extending Shortcode attributes

I've searched many places and tried many ways for this but no success. I have a shortcode in my WP Theme like; [recent_posts layout="thumbnails-on-side" columns="4" number_posts="4" offset="" ...
1
vote
1answer
209 views

Add attribute to shortcode dynamically

I'm looking to add an attribute to a shortcode used in a post dynamically. For example, say we start with: [shortcode-name] I'd like to add the "attribute=xxx" portion to the shortcode so it is ...
0
votes
1answer
19 views

Wordpress shortcode Issue!

Hi I have developed a shortcode that lists posts from a custom post type depending upon taxonomy terms. But I am having an issue. It's displaying all posts from all terms instead of the terms being ...
0
votes
1answer
139 views

How can I define the output of shortcode attribute value?

I would like to create a shortcode that has predefined output for attribute values. For example: [shortcode att="value1"] output = <div id="value1">Predefined content for value1</div> ...
0
votes
1answer
341 views

Input with spaces in Shortcode attributes overwritten by defaults

question seems to be similar to the one asked here but the answer went down a different path. Pretty much if a user enters a shortcode attribute with a space it will get overwritten by the default ...
0
votes
1answer
830 views

Add image custom attribute [closed]

Im want to use Advance Custom Fields module with Gallery add-on http://www.advancedcustomfields.com/add-ons/gallery-field/ I need to add custom attributes to all images. Like for example paper type, ...
3
votes
1answer
2k views

How to add a “data-” attribute to the image tag of native gallery output

While trying to make WordPress and Galleria to become friends I already have a good result. Galleria can easily be used to display native WordPress Galleries. I'm using a plugin but that's not ...
0
votes
1answer
143 views

Which wordpress function is the caption shortcode linked to?

I have used this code in my page content to try and output an image + caption with a custom caption class and id... [caption id="my-caption-id" class="my-caption-class" align="alignnone" ...
1
vote
2answers
242 views

How to add a rel attribute to images that contains their categories?

I've added categories to images, so that I can use them to filter images within a portfolio page. Now I'm thinking I need to add the rel attribute to each image that contains its assigned categories. ...
1
vote
3answers
826 views

How do I add a custom HTML attribute to get_avatar?

I'm trying to add Pinterest's nopin="nopin" HTML attribute to the comment avatar image tags on my blog. Here's the function I'm using to call the avatar on each comment: get_avatar($comment, 50, ...
0
votes
1answer
869 views

Filter to hook into menu <li> items and add a custom attribute

I'm using Foundation as a base and starter theme. I'm trying to build and I can't seem to figure out how to hook into the menu that WordPress outputs and add a custom attribute to that menu's ...
0
votes
2answers
184 views

Remove image height/width attributes from Image Widget

The Image Widget includes width and height on the images which I've unsuccessfully have been trying to filter out so I can have fluid width. I've tried the following, which seems to be the most ...
2
votes
3answers
1k views

Checking if an attribute exists in a shortcode

I've written a small plugin that spits out html for a button. It works great, except for one thing: If the user doesn't specify an image, the image appears broken. Is there a way for me to check and ...
1
vote
1answer
112 views

Shortcode displays only default attribute values

For some reasons every shortcode, that I try to add to functions.php, displays only default attribute value and ignores what I specify in a post. E.g.: function my_shortcode( $atts ) { extract( ...
0
votes
0answers
212 views

Using get_terms() as shortcode attribute

Hop you pepople would be fine. I'm creating a shortcode with the following code. $categories = get_terms( 'project-type' ); foreach ($categories as $category) { ...
0
votes
1answer
371 views

Passing variable in nested shortcodes

How can I pass style attribute of [boxes] shortcode to [box] shortcodes without using global variables? I don't want to use global variables, because I saw on a few articles that using global ...
0
votes
1answer
62 views

How to hide a custom field from admin?

I created a custom field that I would like to hide from the wp-admin (because the system generates it and I don't want user to change it; Hidding it with CSS should be OK in this case), Like this, ...
2
votes
1answer
1k views

Get multiple shortcode attribute values

I'm trying to get several values from a shortcode. I tried several things without success. The shortcode looks like this: [myshortcode metakey="<field_key:key1, title:Title ...
1
vote
0answers
322 views

Create attribute for woocommerce on plugin activation

I want to create attribute on plugin activation.By below code,i'm able to create attribute in database table prefix_woocommerce_attribute_taxonomies but these attributes are not showing (or listed ) ...
6
votes
2answers
2k views

Pass boolean value in shortcode

In WordPress shortcodes, how can I pass boolean attributes? Both of [shortcode boolean_attribute="true"] or [shortcode boolean_attribute=true] are giving string values. EDIT There would be no ...
0
votes
1answer
95 views

Show or hide lang=“ur” in main <body> element

I have RTL website in URDU language. lang="ur" is hard coded in main body i.e. <body lang="ur" <?php body_class(); ?>>. Now I want to replace attribute with some PHP code that will show or ...
1
vote
0answers
385 views

Add ALT attribute to Pin It Button image to pass HTML5 validation

I am using the Pinterest "Pin It" Button plugin so I can add to my posts/images. However, part of the Pin In button uses this code: <img border="0" class="pib-count-img" ...
0
votes
0answers
196 views

Remove “align” attribute on images

I'm trying to get rid of the non W3C compliant "align" attribute generated with any images. For that, I'm using the simple_html_dom library. Here's the code i'm using : add_filter( ...
2
votes
2answers
200 views

How to handle valueless attributes in shortcodes?

Some HTML elements accept valueless attributes such as <input disabled /> or <video autoplay /> How do I handle this case with shortcodes where I want to disable autoplay by default (= ...
0
votes
1answer
102 views

Saving a post, content filtering and user levels

I wrote a function to add and insert additional metadata to images. It looks like this: function add_image_orientation_fields_to_edit($form_fields, $post) { $current_value = ...
0
votes
2answers
3k views

Slider do not add alt attribute. Cant get alt attribute from a media library!

I use a slider to show my post thumbnails. But the problem is that the slider adds thumbnails without the alt attribute: <img src="http://example.com/wallpaper-791556-1180x500.jpg" /> But I ...