Tag Info

Hot answers tagged

4

There were several errors in your code. The biggest was that the function didn't even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append these shares after your post content. If that's the case ...


3

Currently it is practically impossible. Need write your own version of the function. I did just so for my theme in development. There is a trac ticket requesting improvements to the function since it is inflexible, yet required for themes hosted in official repository.


3

Output of items in gallery_shortcode() function is not filtered, so no opportunity to change it there. Markup can only be replaced in full, using post_gallery filter that runs at start of it. It's a little unconventional comparing to usual filtering end result and is probably for performance reasons (generating gallery can be considerably computationally ...


3

I discover that it's a know bug, and will be fix in future release Reference here So then, i used this code... not pretty, but do the magic !, thanks $content = do_shortcode( shortcode_unautop( $content ) ); if ( '</p>' == substr( $content, 0, 4 ) and '<p>' == substr( $content, strlen( $content ) - 3 ) ) $content = substr( $content, 4, ...


2

You are building the URL Wrong since first it needs to be urlencoded and 2nd what is get_thumbnail() does it print the full img tag? and 3rd you are echoing it out. anyway try this /* Pinterest */ $baseurl = 'http://pinterest.com/pin/create/button/?'; $url = 'url='.urlencode(get_permalink()); $mediaUrl = '&media='.urlencode(wp_get_attachment_image_src ...


2

Thanks for your replies, Jan & Rarst. They pointed me in the right direction. Here's what I ended up with. This disables shortcodes in the content. Perfect for this site & the function gets attached images & spits them out as a list. (I found the function somewhere & slimmed it down a little) // Removed shortcodes from the content ...


2

It is good practice to use comment_form() (customized via hooks, if needed) over manually putting form together. For internals of comment reply script and stuff it targets see wp-includes/js/comment-reply.dev.js.


1

If you want change dl lists to ul lists on all galleries, not only on those that request this via extra attributes, you can hook into the post_gallery filter that gets run at the beginning of the gallery_shortcode function. There you can override and set default values for the attributes. The final output is not filtered, but I guess it should be possible ...


1

What you are trying to do works for me. That is, this works when I try it: the_post_thumbnail('post-thumbnail',array('itemprop'=> 'articleSection')); I get the itemprop attribute is my <img tag. If that isn't working for you I can only guess at why. Possibly there is a filter causing problems. For a more global solution, the following will add ...


1

You are probably looking for The Shortcode API that allows to create shortcodes like [my_shortcode] and [my_shortcode]some text[/my_shortcode] to be used in content and other shortcode-enabled areas. More advanced technique are way more involved and might require storing editable and rendered representation of content separately or do apply custom rendering ...


1

If you wanted to do something more advanced than shortcodes, you can also write a plugin that utilizes the Filter API on the_content to apply some sort of transformation when post bodies are displayed. This approach (but with other filters upon saving the editor) is essentially the basis for plugins like WP-Markdown, which allow you to write in the ...


1

Take a look at the source of wp_dropdown_categories(). It uses walk_category_dropdown_tree() to render the output. Right after that you have a filter named wp_dropdown_cats that allows altering the final MarkUp: $output = apply_filters( 'wp_dropdown_cats', $output ); You could now use a Regex and preg_replace or parse it using DOMDocument, etc. Keep in ...


1

In my opinion, using the Styles dropdown is useful to show that the particular style you are adding is special and not the theme's standard element styling for p, h1, h2, etc. The examples in the Codex to be pretty good at outlining this: http://codex.wordpress.org/TinyMCE_Custom_Styles // Callback function to filter the MCE settings function ...


1

I had the same problem and checked the $content in the add_filter() function. There you can see what happen with the shortcodes. I ended up with an easy plugin, that removes silly p and br tags on shortcodes: http://www.johannheyne.de/wordpress/shortcode-empty-paragraph-fix/



Only top voted, non community-wiki answers of a minimum length are eligible