wordpress-snippets

Enable oEmbed Within Text/HTML Widgets

By default if you paste a link to a YouTube video within a WordPress post, it automatically embeds the video – unfortuneatly if you paste a video URL into a text widget this doesn’t happen. Paste the below into your functions.php file to turn on oEmbed functionality for text/HTML widgets:

 

wordpress-snippets

Enable Shortcodes in Widgets Without a Plugin

It’s annoying that WordPress doesn’t automatically allow shortcodes in widgets, luckily it only requires a few lines of code to include this functionality. Paste the below into your functions.php file:

 

wordpress-snippets

Change Default Length of Excerpt in WordPress

I think by default the WordPress excerpt is set to 55 words. With the below snippet you can change the excerpt length to whatever you want, the below limits it to 100 words but you can change the ‘100’ to whatever you like, paste the below into your functions.php file:

 

wordpress-snippets

Stop WordPress Pinging Itself When you Link Internally

I find it very annoying when I place a link on one post, to another post and then I get a comment notification within the WordPress admin informing me there has been a ping/trackback to one of my posts. With the below snippet you can stop this happening (place in functions.php file):