Add attribute to existing Shortcode
Add attribute to existing Shortcode
Add attribute to existing Shortcode
Inside this loop: foreach ( $attachments as $id => $attachment ) { $link = isset($attr[‘link’]) && ‘file’ == $attr[‘link’] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); $output .= “<{$itemtag} class=”gallery-item”>”; $output .= “<span class=”photos-comment-number-wrap”><span class=”comment-number”>”. comments_number() .”</span></span>”; $output .= ” <{$icontag} class=”gallery-icon”> $link </{$icontag}>”; if ( $captiontag && trim($attachment->post_excerpt) ) { $output … Read more
This is a filter in WordPress called wpautop it is there to make formatting cleaner when publising posts, however when you want more control over formatting it can be a pain. It basically wraps returns in paragraphs so that the space you see in the editor is obeyed on the front end. You can disable … Read more
As @Milo said, wordpress.com is a platform on its own, and everything available on wordpress.com is only available to sites hosted on wordpress.com. The jetpack plugin does however make some features available to self hosted sites but I’m not particulary sure which ones. The shortcodes you are talking about is only available on sites hosted … Read more
As I have stated, you can do all of the above in your question with only one shortcode. The idea here would be to Use usort() to sort posts according to term name Pass a string of term names in the order you need to display them to the shortcode FEW IMPORTANT NOTES Never ever … Read more
You can place only the following code in functions.php and it will work: // Activate Shortcode Execution for Contact Form 7 add_filter( ‘wpcf7_form_elements’, ‘do_shortcode’ );
the text widget doesn’t do php…. Here’s my fave solution http://wordpress.org/extend/plugins/php-code-widget/ It’s from Otto, so ya know it’s good. Based heavily on the text widget, but allows for php
Using the the_posts filter: Here’s one idea using the the_posts filter, that fires before setup_postdata() is activated: /** * Replace [nextpage] with <!–nextpage–> through the ‘the_posts’ filter. * * @see http://wordpress.stackexchange.com/a/183980/26350 */ ! is_admin() && add_filter( ‘the_posts’, function( $posts ) { $posts = array_map( function( $p ) { if ( false !== strpos( $p->post_content, ‘[nextpage]’ … Read more
you can override the shortcode like this : add_action(“init”, function () { remove_shortcode(“timelinr”); add_shortcode(“timelinr”, function ($atts, $content) { // call the shortcode of jqueryTimelinrLoad $result = $GLOBALS[“jqueryTimelinrLoad”]->shortcode($atts, $content); // dequeue style wp_dequeue_style(“timelinr-style”); // enqueue your style wp_enqueue_style(“timelinr-style2”, “new.css”); // result of the shortcode return $result; }); });
I may have found the problem (from product_attribute) array( ‘per_page’ => ’12’, ‘columns’ => ‘4’, ‘orderby’ => ‘title’, ‘order’ => ‘asc’, ‘attribute’ => ‘asc’, ‘filter’ => ‘asc’ ) [product_attribute attribute=”color” filter=”black”] Notice the attibute is in single quotes wheras yours is in double quotes: do_shortcode (‘[product_attribute attribute=”Grams”]’); also you may need it to be in … Read more