The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
276 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
0answers
17 views

WooCommerce works very slow with multiple attributes [closed]

I'm building a webstore with electronics and household appliances. Therefore I'm having quite a number of product attributes. To be precise: 1,196 total. And this number leads me to over 9000 (yeah ...
0
votes
0answers
28 views

show title attributes above gallery thumbnail

I'm using the wordpress gallery to generate a list of thumbnails each with captions. However i would also, on some occasions, like to add the ability to have individual titles for certain images. Im ...
0
votes
1answer
28 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
56 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 ...
2
votes
1answer
455 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 ...
3
votes
1answer
214 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 ...
-2
votes
1answer
99 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, ...
1
vote
2answers
64 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. ...
5
votes
5answers
4k views

How can I add title attributes to next and previous post link functions?

For some reason a title attribute is not appended to next_post_link and prev_post_link calls in WordPress. How can I add one?
0
votes
1answer
44 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
155 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
2answers
81 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 ...
1
vote
3answers
205 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 ...
0
votes
1answer
51 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
132 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
174 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
47 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
2answers
1k 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
2answers
814 views

Remove height attribute from wp_get_attachment

I found this great solution: Stop wordpress from hardcoding img width and height attributes But I was wondering if I could do it only in one specific case and not in all the site because it messes up ...
1
vote
0answers
164 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 ) ...
1
vote
3answers
762 views

Caption shortcodes not including caption as attribute

I recently installed the bonpress theme and am having trouble with the captions showing correctly. The more I try to understand how captions are supposed to work in Wordpress, the more I suspect ...
0
votes
1answer
79 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
245 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
119 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( ...
1
vote
3answers
2k views

Escaping quotes from shortcode attributes

I have been trying to figure out how to escape quotes (single and double) from shortcode attributes. Basically the content is written by the user and therefore can potentially include " and ' quotes. ...
2
votes
2answers
129 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 (= ...
1
vote
1answer
738 views

Remove 'rel' attributes from the_category() output

I am trying to get the categories associated with a post in it's meta section by using the following code: <div>FILED AS: <span class="gf-post-meta-result"><?php the_category(' ...
0
votes
1answer
84 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
1k 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 ...
2
votes
2answers
2k views

Automatically add this attribute to the gallery shortcode

When inserting a gallery it adds the following shortcode: [gallery columns="6" ids="18,150,146,23,147,17,21,20,22"] I would like it to automatically add link="file" as the last attribute, whenever ...
1
vote
2answers
2k views

Remove width and height attributes from [gallery] output

WordPress automatically adds the width and height attributes to [gallery] shortcode images. How to delete these attributes? Something like this but for [gallery] output.
1
vote
1answer
3k views

Adding width and height to wp_get_attachment_image_src

I'm trying to add the width and height attributes to the wp_get_attachment_image_src. Why is this returning width and height:0? <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( ...
2
votes
1answer
72 views

getting values from a shortcode with an include

I have a checked a few links but nothing seems to for me in getting the attribute value of a shortcode so that I can use it in a condition. function bf_shortcode_slideshow($atts) { ...
0
votes
1answer
2k views

Remove image classes from post thumbnail output

I wish to remove the image classes generated by default in the output whenever post_thumbnail() is called - <img width="1024" height="768" ...
0
votes
1answer
51 views

Problem Locating and Changing Alt Attribute Of Link

I'm a totally amateur so please dumb it down for me. My WP them has a Social Links in the header of the theme and I want to change the Linkedin link link to a Pinterest link and change the Alt ...
1
vote
2answers
1k views

Stop wordpress from removing HTML attributes

I try to insert a post with html tag with class attribute, like this: <dl class="dl-horizontal">, but after saving the post, WP removes an attribute. How can I fix it? The only way I've found, ...
1
vote
2answers
1k views

Removing width and height attributes from wp-get-attachment

I'm using this http://www.ghosthorses.co.uk/production-diary/removing-inline-img-dimensions-for-responsive-wordpress-websites/ to remove the height and width attributes of images. Everything works ...
2
votes
1answer
275 views

wpautop() when shortcode attributes are on new lines break args array

I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors: [component attr1 ="value1" ...
1
vote
2answers
2k views

Replace image attributes for lazyload plugin (data-src)

I want to apply jquery lazyload plugin. For this to work I have to create a new attribute which is data-src place there the src value and then replace the src value with a specific value ...
1
vote
1answer
742 views

How to retrieve alt attribute for an attachment (uploaded image)?

I have some IDs of attachments (images, not from current post). How to I get the alt attribute for those images? I have tried to look into wp_get_attachment_image_src and wp_get_attachment_metadata ...
0
votes
1answer
743 views

Echo title attribute php

I have the following in functions.php: function twentyten_continue_reading_link() { global $id; return ' <span class="readmore"><a href="'. get_permalink($id) . '" title="' . ...
0
votes
1answer
113 views

WordPress strips some attributes for author posts

I added template to my WP posts, so when you click Add New content area alreday with text. Template smt. like this <div id="myDiv"><p>Add your text here</p></div> If user ...