Calling function from within functions.php returns unwanted value

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

Wraping $content into link with shortcodes

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

Debugging shortcode problems

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 a shortcode within the loop?

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

change plugin shortcode function [closed]

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; }); });

shortcode not working [closed]

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