Tag Info

Hot answers tagged

5

Filter the_category, and remove those attributes: add_filter( 'the_category', 't5_remove_cat_rel' ); function t5_remove_cat_rel( $list ) { return str_replace( array ( 'rel="category tag"', 'rel="category"' ), '', $list ); }


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

There was a trac ticket requesting improvements to the function since it was inflexible, yet required for themes hosted in official repository. It had been resolved, adding much needed wp_link_pages and wp_link_pages_link filters, so now output can be cleanly modified without need to use custom function. I went through quite a few takes on this over years ...


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

This is a tricky one, but very doable. After looking at Mark's Markdown on Save plugin which does the exact thing you want but for posts content instead of comments i started thinking, that saving the comment content as Markdown would be bad because you would have to render the Markdown to HTML on-the-fly for each comment you display so the idea behind that ...


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

take a look at comment_form(); and probably add wp_enqueue_script( 'comment-reply' ); in your theme's header.php


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.


2

You should really use comment_form() instead of rolling your own. Still, if you must, make sure that: The textarea has id="comment". The wrapping container around the entire comment form (probably a DIV) has id="respond".


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

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 ...


1

File with this name comes up in search as part of Adsense Optimizer plugin (SVN). Curiously I don't see stylesheet actually being queued in code... Are you using this plugin? Up to date version?


1

What sort of custom markup do you need? Can you elaborate a little more?


1

If you're looking to change the way the tag cloud is displayed, you can use get_tags() to heavily alter the output and create a custom widget.


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

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/


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

The TinyMCE Custom Styles Codex Page should get you through this. There are code snippets on that page, but, as an overview, the process requires two steps: Add the TinyMCE "styleselect" element to the first or second row of icons. Add one or more elements to that styleselect menu. If this were me, I would consider also removing the blockquote button ...


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 ...



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