iPixel Creative is a Singapore web design and development Company. At iPixel Creative, we provides web design solution which helps your company stand out from the competitors. Our Solutions includes web design, website development, cms development, ecommerce solution and hosting solutions.
This post however is on a few tricks you can use on YouTube, for instance, did you know that you can make GIF files from any YouTube videos with just a few clicks? You might like that trick and a few others that are great not only for video lovers but also for video makers.
For more tricks, check out the two earlier posts we have on YouTube tricks (Part 1, Part 2) as well as this post on keyboard shortcuts you can use on YouTube.
1. Adding Watermark Or Branding Logo
YouTube allows the addition of a logo of watermark of a brand for your channel, company or organization in your YouTube videos. Sign in to your YouTube account and click on the Creator Studio button.
Click on CHANNEL > Branding > Add a watermark > Choose File Button > Save > Update.
Then, you can define the Display time for the watermark or logo to be displayed on your video. You need to only do this once and the watermark will appear in all of your uploaded videos.
2. Multi-Camera Option Under "Choose Your View"
What if you can view videos of concerts and sport matches from a variety of angles? You can watch your favorite artists perform their act from the side of the stage, from upfront, from above or real upclose.
YouTube is now testing this feature and will make it available soon to the users uploading videos that can take advantage of multiviews. Here’s a sample of what you can expect from this cool feature, courtesy of Madilyn Bailey.
3. Extracting A GIF File From A Video
Bet you didn’t know that you could turn a portion of a YouTube video into a GIF file. Here’s how. Here’s an example of a video I want to create a GIF from.
All I have to do is add the word “gif” before the word "YouTube".This will take me to a third party service where I can pick the starting time, length of GIF, title and caption to use for the GIF file I want to create.
Alternatively, just go to the gifyoutube site, then paste a link to the Youtube video you want to give the GIF treatment to. Customize the section you want to be taken out, then click CREATE GIF to get your file.
4. Adding Interactive Cards To Your Video
Here’s a feature that introduce some interactivity in your YouTube videos. It’s called Cards. Cards can be displayed on your videos for multiple purposes including to link to another video or even a playlist that the viewer might like. Alternatively, you can also add a related website as a card to the video.
To add a card to your YouTube video, Sign in and select a video that is already uploaded. When you find the video, look for the Cards button below the video (see screenshot).
Then, choose from any of the 6 types of cards available. On top of the recommended video, playlist and relevant website cards, you can also put in cards for fundraising, merchandise and fan funding purposes. Read more about them here.
Note: Not all videos can get this feature inserted – only videos that are in "good standing", which means no copyright strikes or community guidelines strikes, and you shouldn’t have had a global content ID block on any of your uploaded videos. Deleting videos that were affected will not help improve your standings.
5. Viewer-Contributed Subtitles & Closed Captions
Did you know that you con contribute subtitles and closed captions to videos that are not uploaded by you? Some channels allow viewer-contributed subtitles, so if you feel like doing a bit of translating or if you want to fix annoying subtitles that were wrong in the first place, here’s how you do it:
If video has subtitles or closed captions already, click on More > Transcript or CC menu in the player > Language > Add Subtitles/CC. If video does not have subtitles or closed captions then click on More > Transcript > Add Subtitles / CC.
Once subtitles are submitted and approved then the pre-existing subtitles will be overwritten.
6. YouTube TV Mode for Big Screens
YouTube TV is an interface for viewers who prefer to watch YouTube videos on their television, with popcorn, on a nice comfy couch. What’s not to like? The problem with watching YouTube on a TV is that you can’t use a mouse to do your clicking. Instead, it’s the video arcade era "letter-by-letter" shift that you have to deliver via keyboard.
Ain’t nobody got time for that! Pair your smartphone with your smart TV with this interface then use your smartphone to do all your video choosing and pausing and more.
7. Advance Search & Filter Options
Do you know that in YouTube, there are many advance search and filtering options that may be handy to get the exact video you are looking for? When you search for a query, and you click on any of the suggestions, you will arrive at a list of returned results. At the top left there is a Filters button. Click it to unveil a list of search options.
You can filter your search by Upload date, Type, Duration, Features or Sort by depending upon the requirements.
If you directly want to search a video with some specific filtering criteria then you can do it easily by separating the search phrase and filtering criteria using a comma ( , ). For example, you want to search a video on computer basics with duration less than 4 minutes then type in: basics of computer, Duration, Short and hit the search button.
8. Embed Video With Specific Start & End Time
So you found a video you want to embed in your blog but you don’t want to embed the whole thing, just the part you find interesting, funny, or worth sharing, what do you do? You can actually embed a portion of the video with a specific start & stop time.
Click on Share > Embed and right at the end of YouTube video link insert ?start=ss&end=ss, where ss represents seconds, start = ss means start time in seconds, end = ss means end time in seconds.
Replace the "ss" with the time in seconds, from the start of the video, e.g. start=11 indicates 0:11 as the starting time for the video.
You can also set the resolution of the video to be shown, in your embedded link. Go to the video you want to share. Locate the Share > Embed option below the video. Click SHOW MORE to see a preview of your video.
Under the video, is the option to choose the Video size you want to embed. There are other options there that you can tinker with including showing other recommended videos at the end of your embedded video and more. Grab the embed link once you have made your choices.
10. Add A Subscription Link And Button To Your Video
To add a subscription link, login to YouTube account, go to your Video Manager and click Edit on any of your uploaded videos. Head over to the Annotations section.
You can choose 1 of 5 types of annotation: Speech Bubble, Note, Title, Spotlight or Label. Pick any one, for instance, Note and write "Click here to subscribe"
Select the font size and color, then specify the start and end time to show this subscription link.
Click on Link check box, select Subscribe and enter your YouTube user name. You can also specify whether to open subscription link in new tab or not.
Once you are done with all configurations for your subscription link then click on Save > Apply changes.
If you prefer the use of a button for your CTA, then you can upload a Subscribe button image as your watermark, using tip #1.
11. Adding Audio & Video Effects
If you want to replace the original playback audio of your YouTube video with some other audio file, go to select an uploaded video and choose Audio. To the right of the video, there are playback tracks to choose from in multiple categories.
Choose a track, then click on Save as new video. You can also discard changes, by clicking on Revert to Original.
12. Enhance Your Videos With Fixes, Filters And Effects
Apart from audio enhancements, your video can also enjoy other forms of enhancements. Go to the Enhancements section for
The Quick fixes to auto-fix problems in your video, stabilize shaking footage, change the speed or timelapse of your video, trim and rotate your video.
You can also apply a color filter on your video under the Filters option. Lastly, if you would like to blur faces in your video, go to the Special effects section. You can see the original and a preview of the changes you chose in a side-by-side comparison before saving your enhancements.
Additionally, you can combine multiple clips to publish a new supercut video from all your uploaded clips, by clicking the YouTube Video Editor.
This post however is on a few tricks you can use on YouTube, for instance, did you know that you can make GIF files from any YouTube videos with just a few clicks? You might like that trick and a few others that are great not only for video lovers but also for video makers.
For more tricks, check out the two earlier posts we have on YouTube tricks (Part 1, Part 2) as well as this post on keyboard shortcuts you can use on YouTube.
1. Adding Watermark Or Branding Logo
YouTube allows the addition of a logo of watermark of a brand for your channel, company or organization in your YouTube videos. Sign in to your YouTube account and click on the Creator Studio button.
Click on CHANNEL > Branding > Add a watermark > Choose File Button > Save > Update.
Then, you can define the Display time for the watermark or logo to be displayed on your video. You need to only do this once and the watermark will appear in all of your uploaded videos.
2. Multi-Camera Option Under "Choose Your View"
What if you can view videos of concerts and sport matches from a variety of angles? You can watch your favorite artists perform their act from the side of the stage, from upfront, from above or real upclose.
YouTube is now testing this feature and will make it available soon to the users uploading videos that can take advantage of multiviews. Here’s a sample of what you can expect from this cool feature, courtesy of Madilyn Bailey.
3. Extracting A GIF File From A Video
Bet you didn’t know that you could turn a portion of a YouTube video into a GIF file. Here’s how. Here’s an example of a video I want to create a GIF from.
All I have to do is add the word “gif” before the word "YouTube".This will take me to a third party service where I can pick the starting time, length of GIF, title and caption to use for the GIF file I want to create.
Alternatively, just go to the gifyoutube site, then paste a link to the Youtube video you want to give the GIF treatment to. Customize the section you want to be taken out, then click CREATE GIF to get your file.
4. Adding Interactive Cards To Your Video
Here’s a feature that introduce some interactivity in your YouTube videos. It’s called Cards. Cards can be displayed on your videos for multiple purposes including to link to another video or even a playlist that the viewer might like. Alternatively, you can also add a related website as a card to the video.
To add a card to your YouTube video, Sign in and select a video that is already uploaded. When you find the video, look for the Cards button below the video (see screenshot).
Then, choose from any of the 6 types of cards available. On top of the recommended video, playlist and relevant website cards, you can also put in cards for fundraising, merchandise and fan funding purposes. Read more about them here.
Note: Not all videos can get this feature inserted – only videos that are in "good standing", which means no copyright strikes or community guidelines strikes, and you shouldn’t have had a global content ID block on any of your uploaded videos. Deleting videos that were affected will not help improve your standings.
5. Viewer-Contributed Subtitles & Closed Captions
Did you know that you con contribute subtitles and closed captions to videos that are not uploaded by you? Some channels allow viewer-contributed subtitles, so if you feel like doing a bit of translating or if you want to fix annoying subtitles that were wrong in the first place, here’s how you do it:
If video has subtitles or closed captions already, click on More > Transcript or CC menu in the player > Language > Add Subtitles/CC. If video does not have subtitles or closed captions then click on More > Transcript > Add Subtitles / CC.
Once subtitles are submitted and approved then the pre-existing subtitles will be overwritten.
6. YouTube TV Mode for Big Screens
YouTube TV is an interface for viewers who prefer to watch YouTube videos on their television, with popcorn, on a nice comfy couch. What’s not to like? The problem with watching YouTube on a TV is that you can’t use a mouse to do your clicking. Instead, it’s the video arcade era "letter-by-letter" shift that you have to deliver via keyboard.
Ain’t nobody got time for that! Pair your smartphone with your smart TV with this interface then use your smartphone to do all your video choosing and pausing and more.
7. Advance Search & Filter Options
Do you know that in YouTube, there are many advance search and filtering options that may be handy to get the exact video you are looking for? When you search for a query, and you click on any of the suggestions, you will arrive at a list of returned results. At the top left there is a Filters button. Click it to unveil a list of search options.
You can filter your search by Upload date, Type, Duration, Features or Sort by depending upon the requirements.
If you directly want to search a video with some specific filtering criteria then you can do it easily by separating the search phrase and filtering criteria using a comma ( , ). For example, you want to search a video on computer basics with duration less than 4 minutes then type in: basics of computer, Duration, Short and hit the search button.
8. Embed Video With Specific Start & End Time
So you found a video you want to embed in your blog but you don’t want to embed the whole thing, just the part you find interesting, funny, or worth sharing, what do you do? You can actually embed a portion of the video with a specific start & stop time.
Click on Share > Embed and right at the end of YouTube video link insert ?start=ss&end=ss, where ss represents seconds, start = ss means start time in seconds, end = ss means end time in seconds.
Replace the "ss" with the time in seconds, from the start of the video, e.g. start=11 indicates 0:11 as the starting time for the video.
You can also set the resolution of the video to be shown, in your embedded link. Go to the video you want to share. Locate the Share > Embed option below the video. Click SHOW MORE to see a preview of your video.
Under the video, is the option to choose the Video size you want to embed. There are other options there that you can tinker with including showing other recommended videos at the end of your embedded video and more. Grab the embed link once you have made your choices.
10. Add A Subscription Link And Button To Your Video
To add a subscription link, login to YouTube account, go to your Video Manager and click Edit on any of your uploaded videos. Head over to the Annotations section.
You can choose 1 of 5 types of annotation: Speech Bubble, Note, Title, Spotlight or Label. Pick any one, for instance, Note and write "Click here to subscribe"
Select the font size and color, then specify the start and end time to show this subscription link.
Click on Link check box, select Subscribe and enter your YouTube user name. You can also specify whether to open subscription link in new tab or not.
Once you are done with all configurations for your subscription link then click on Save > Apply changes.
If you prefer the use of a button for your CTA, then you can upload a Subscribe button image as your watermark, using tip #1.
11. Adding Audio & Video Effects
If you want to replace the original playback audio of your YouTube video with some other audio file, go to select an uploaded video and choose Audio. To the right of the video, there are playback tracks to choose from in multiple categories.
Choose a track, then click on Save as new video. You can also discard changes, by clicking on Revert to Original.
12. Enhance Your Videos With Fixes, Filters And Effects
Apart from audio enhancements, your video can also enjoy other forms of enhancements. Go to the Enhancements section for
The Quick fixes to auto-fix problems in your video, stabilize shaking footage, change the speed or timelapse of your video, trim and rotate your video.
You can also apply a color filter on your video under the Filters option. Lastly, if you would like to blur faces in your video, go to the Special effects section. You can see the original and a preview of the changes you chose in a side-by-side comparison before saving your enhancements.
Additionally, you can combine multiple clips to publish a new supercut video from all your uploaded clips, by clicking the YouTube Video Editor.
Previously we have featured more than 30 hacks and tricks to customize WordPress. But WordPress has been through several iterations and updates since the publication of that compilation. Some WordPress functions has been dropped, some have been replaced with better approaches that render some tricks you know no longer usable.
We figured that you might want new tips, tricks and hacks that do work with the latest version of WordPress. Here are 50. As a friendly reminder, please practice caution when attempting any of the tips in the Advanced section because you might render your site unusable if you don’t know what you are doing.
1. Disabling Full-Height Editor
WordPress 4.0 added a subtle UX change in the editor. If you are scrolling or writing a length paragraph, the height of the editor will match the height of your screen, eliminating the scroll-bars inside the editor.
To reach some panels like the Excerpt and Custom Fields that reside below the editor, you need to scroll all the way down through the end of paragraph. If you don’t want this, tick the option off in the Screen Options panel.
Compatibility: WordPress 4.0
2. Embed Before and After Image Comparison
Have you ever experienced image comparison where you can slide to the right to see the before and to the left for the after? If you want to display something like that on your website, you can install TwentyTwenty. This plugin is based on Zurb TwentyTwenty. The plugin introduces a new shortcode, [twentytwenty], where you can add two images to compare.
Compatibility: WordPress 3.5.1 or higher
3. Revert Plugins or Themes to Previous Version (Easily)
As with any other system update, there is a chance that a new plugin or theme update may accidentally screw up your website. WordPress does not allow us to revert to the previous version but you can install this plugin WP-Rollback to get that functionality. Once it is activated it will add a link “Rollback” on any installed plugin.
Compatibility: WordPress 3.8 or higher
4. Organize Admin Menu
Use this plugin, Admin Menu Manager, to organize each menu order in admin via a drag-and-drop interface.
Compatibility: WordPress 4.0 or higher
5. Text Editor SyntaxHighlighter
The WordPress text-mode editor is pretty plain. You can make it more user-friendly by installing HTML Editor SyntaxHighlighter, a plugin that adds syntax coloring like in a code editor. It will make editing a lot easier, especially if you use Text-mode editor more often than the Visual (WYSIWYG) counterpart.
WordPress search is poorly built, cumbersome, and don’t let me start on its search result accuracy. But don’t let that stop you from adding voice search capability to it. Once installed you will notice a “microphone” icon appear in the search box.
Compatibility: WordPress 2.6 or higher
8. Install WordPress Plugin via Github
Did you find a WordPress plugin in Github that you want to install in your website? Follow this tip on how to install plugins conveniently with just a few clicks. Be careful though of what you install as plugins are not moderated. There may be a chance that malicious codes may allow infiltration of your website.
Compatibility: WordPress 3.6 or higher
9. Install Plugin with Single Click
For more plugin management, you could install WP-Core. This is a plugin that makes WordPress plugin installations more streamlined. You can also makes a Collection to put several plugins together and install them with one click.
Compatibility: WordPress 3.5 or higher
10. Advanced Image Styles
We used to able to set margins and borders when we insert images to the content. From WordPress 3.9 onwards, these options were removed. If you missed them, you can install this plugin to bring these options back.
Compatibility: WordPress 3.9 or higher
11. Show Disk Usage Chart
Install this plugin Disk Usage Sunburst to display a beautiful visualization, similar to DaisyDisk, of your website disk space usage. A quite useful utility to add to your website.
Compatibility: WordPress 4.0 or higher
Advanced
Beyond this point are advanced tips and tricks for those who feel like exploring, and those who enjoy getting their hands dirty with codes. However, many of the following tips may render your website unusable, hence they should be carried out with more attention and with extra caution.
12. WordPress Output Debug File
This snippet will tell WordPress to save the debug log error in a .log file instead of displaying it in the front-end. A handy snippet to enable WordPress debugging in a live site.
Run and enable all Jetpack modules offline including the modules that actually requires you to connect to WordPress.com to work; a useful tip if you are developing and integrating Jetpack modules to your theme.
Compatibility: WordPress 4.1
14. Login to WordPress with Email Address
WordPress exposes a user’s username, which makes it a step easier for brute-force attacks. You can consider changing login parameters with an email and password combination instead of by username using this hack.
Another way you can use is by installing Disabler plugin. It is a plugin that allows you to turn on or off certain WordPress functionality including disabling self-ping.
Compatibility: WordPress 2.0
16. Pre-Populate Content
This tip is quite useful if you want to add default content each time you create a new post, page, or custom post type content; the idea is similar to adding a standard signature when creating new emails.
Compatibility: WordPress 1.5
17. Custom Class for Post
The following tip explores some customization of WordPress Post Class thoroughly with post_class. It’s helpful if you want to be more specific with regards to your post styles.
Compatibility: WordPress 2.7
18. Adding Google Fonts (the Right Way)
Another great tip from ThemeShaper, a complete guide to add Google Font to your WordPress theme correctly. It includes how to add it in the front-end, in the editor, and how to ensure compatibility for different languages.
Compatibility: WordPress 3.0
19. Loading Alternative Template
WordPress uses single.php to show post content. If you want to change it to, perhaps, post.php, this tip will show you how to override default WordPress templates correctly.
add_filter( "template_include", "my_callback" ); function my_callback( $original_template ) if ( some_condition() ) return SOME_PATH . "/some-custom-file.php"; else return $original_template;
Compatibility: WordPress 1.5
20. WordPress Theme Customizer from Scratch
WordPress 3.4 adds a new API called Customizer which allows you to build controls to customize theme and see the result in real-time. The Customizer API may be overwhleming for some, though, as it involves multi-disciplinary code sets including PHP, JavaScript, Ajax, and jQuery.
Nonetheless, Theme Foundation has compiled a complete guide to WordPress Customizer. You will learn how to add the Customize menu, build Sections, Settings, Input Controls as well as Panels, and learn their functions all together – in and out. An essential reference for WordPress theme developers.
Compatibility: WordPress 3.4
21. Using Vagrant with WordPress
Vagrant is a great tool to create a virtual environment, and to run a test of your WordPress development to ensure that themes and plugins would work in varying instances. In this following tip, Daniel Pataki, will walk you through how to get your WordPress site up and running with Vagrant.
Compatibility: Any WordPress Version
22. Retrieving WordPress Gravatar URL
The WordPress get_avatar() is a handy function to get a user’s avatar; the function retrieves the image along with the img element. But sometimes I want to grab just the image URL so that I could freely and easily add custom classes or ids to the image.
If you have this in mind, add the following code in your functions.php:
Here’s a more detailed post to break it down for you.
Compatibility: WordPress 1.5
23. Remove Classes From Menu
WordPress, by default, adds a bunch of classes. While this is good to allow extensive customization, the menu HTML markup looks really cluttered. Tidy it up and add only the class you need with the snippet below.
SSL, not only secures your website, but also bumps up the rankings in Google search result. In the following tip, Jenni McKinnon covers how to deploy SSL in WordPress multisites that may employ multiple sub-domains.
Compatibility: WordPress 3.0.0
25. Customizing WordPress Content Editor
Adding styles to the editor will improve the writing experience in WordPress editor. You can match the typographic styles of the backend with the front-end allowing you to see the final version (or a version as close to the final as possible) while writing. This will reduce the switching of back and forth between the editor and the content output.
function my_editor_styles() add_editor_style( "editor-style.css" ); add_action( "admin_init", "my_editor_styles" );
Compatibility: WordPress 3.0.0
26. Creating Plugin Welcome Screen
If you have just updated WordPress you will be redirected to a special screen, showing the details of the latest version you have just installed, the contributors, the additions as well as all the changes made under the hood. This tip, Creating a Welcome Screen For Your WordPress Plugin by Daniel Pataki will guide you through how to build a welcome screen for your own plugin.
Compatibility: WordPress 3.6
27. Customize Jetpack Mobile Theme
Jetpack comes with a Mobile Theme. It is a special theme that is used when the website is viewed on mobile devices. And like any other theme, we can customize it. Here’s a how-to by Jeremy, one of Jetpack developers, on how to customize the Jetpack Mobile Theme. It’s a good alternative to consider in place of responsive web design.
Compatibility: WordPress 3.8
28. Adding Featured Image To Category
Want to add a featured image for a Category and display it in your theme? This feature is missing from WordPress, which could actually be useful for theme developers.
Compatibility: WordPress 3.6
29. Display Hidden “All Settings”
A WordPress easter egg, this code snippet will add all settings in the WordPress database into one page.
function all_settings_link() add_options_page(__("All Settings"), __("All Settings"), "administrator", "options.php"); add_action("admin_menu", "all_settings_link");
Compatibility: WordPress 3.1
30. Remove Update Notification
WordPress, by default, display update notifications to all user levels when they are logged in to the backend. Add the following codes to hide WordPress update notification except for users with Administrative privilege.
global $user_login; get_currentuserinfo(); if (!current_user_can("update_plugins")) // checks to see if current user can update plugins add_action( "init", create_function( "$a", "remove_action( "init", "wp_version_check" );" ), 2 ); add_filter( "pre_option_update_core", create_function( "$a", "return null;" ) );
Compatibility: WordPress 3.0.1
31. Add Thumbnail In Post/Page Edit List
This code will display featured images you have assigned to post in the Post column. A useful trick to see which post has a thumbnail and which does not. Note that your theme should support post thumbnails.
WordPress adds a bunch of things in the <head> such as WordPress version, RSD Link, and Shortlink, info that’s not all that useful. To remove these bits of info, use this:
Remove either one of remove_action from the above snippet of which you want to retain.
Compatibility: WordPress 2.0
34. Smart WP_Debug
Ideally you should not enable the WP_Debug in a live site as it will expose critical information. But if you need a trick to do so safely, here it is:
if ( isset($_GET["debug"]) && $_GET["debug"] == "1" ) // enable the reporting of notices during development - E_ALL define("WP_DEBUG", true); elseif ( isset($_GET["debug"]) && $_GET["debug"] == "2" ) // must be true for WP_DEBUG_DISPLAY to work define("WP_DEBUG", true); // force the display of errors define("WP_DEBUG_DISPLAY", true); elseif ( isset($_GET["debug"]) && $_GET["debug"] == "3" ) // must be true for WP_DEBUG_LOG to work define("WP_DEBUG", true); // log errors to debug.log in the wp-content directory define("WP_DEBUG_LOG", true);
With the above code added, you can enable debugging by adding ?debug=2, ?debug=1, ?debug=3 at the end of the URL to see the error that occurs in your website.
Compatibility: WordPress 2.0
35. Enable Shortcode In Widget
The following is a useful piece of code if you want to embed Youtube or SoundCloud in the widget area with a shortcode.
Set the default type of editor your users can use. Change the $editor either to html or tinymce. Of course, user would still be able to opt out of the default.
function my_default_editor() $editor = "tinymce"; // html or tinymce return $editor; add_filter( "wp_default_editor", "my_default_editor" );
Compatibility: WordPress 2.5.0
37. Prolong Auto-logout
WordPress allows one to remain logged in for 48 hours, plus an extension of 14 days if we check the “Remember Me” option at login. If however you are sure your computer will not be breached by a second or third party, you can add this code to keep yourself logged in for up to a year. You will only be prompted for a login once a year.
function keep_me_logged_in_for_1_year( $expirein ) return 31556926; // 1 year in seconds add_filter( "auth_cookie_expiration", "keep_me_logged_in_for_1_year" );
Compatibility: WordPress 2.8.0
38. Always Use Figure
WordPress will wrap img with a p tag. If you are an HTML semantic purist, you can add this code to force WordPress to wrap image with the figure element.
“Administrator”, “Author”, and “Subscriber” are the names given for WordPress users at the administrative level. To change these default names to something that sounds more apt for your website, add the following code, then make the change to the names to what you prefer:
function change_role_name() global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); $wp_roles->roles["contributor"]["name"] = "Freelance"; $wp_roles->role_names["contributor"] = "Freelance"; add_action("init", "change_role_name");
Compatibility: WordPress 3.1
40. Default Attachment Settings
Here’s a snippet that lets you specify the default size, alignment, and the link for images you want to embed in the editor.
Some of us prefer posts to be released with a Featured Image. This post, Validate Featured Image On Post, by Paul Underwood will show you how to make your users upload a featured image before their post can be published.
Compatibility: WordPress 3.0
42. Custom Image Size In Media Uploader
add_image_size is the WordPress function that allows us to crop and display custom image size. If you want to allow users to add image within this custom size, add the following codes to show the “custom image size” option in the WordPress media uploader.
43. Load Script Only If A Particular Shortcode Is Present
In a previous post we have shown you how to create a custom shortcode. If your shortcode requires a JavaScript function, follow The Jedi Master way by Silviu-Cristian Burcă (famously known as Scribu) to ensure that you only load the JavaScript when the shortcode is applied.
Compatibility: WordPress 2.6
44. Menu Description
When you add in a menu through Appearance > Menu, you will see an input to add “Description”. But you won’t find it anywhere in the front-end as we have to customize the WordPress default menu template to include the description.
Here is an elegant way to do so.
function add_description_to_menu($item_output, $item, $depth, $args) if (strlen($item->description) > 0 ) // append description after link $item_output .= sprintf("<span class="description">%s</span>", esc_html($item->description)); // insert description as last item *in* link ($input_output ends with "</a>$args->after") //$item_output = substr($item_output, 0, -strlen("</a>$args->after")) . sprintf("<span class="description">%s</span >", esc_html($item->description)) . "</a>$args->after"; return $item_output; add_filter("walker_nav_menu_start_el", "add_description_to_menu", 10, 4);
Compatibility: WordPress 3.0.0
45. Using Dashicons
You can now use WordPress’s very own crafted font icon, Dashicons, to add icons to the wp-admin menu. Check out our tutorial on how to start using Dashicons.
Compatibility: WordPress 3.8
46. Customize “Howdy” Message
Follow our previous tutorial to change the WordPress nonsensical “howdy” message that appears at the admin bar to something more personalized.
Compatibility: WordPress 2.9
47. Exclude Post From The Jetpack Popular Widget
Jetpack comes with a widget that allows you to show the most viewed or popular posts and pages. But sometimes your most popular pages could be the home page or a page that you do not want to include in the most viewed pile.
Add the following code to remove that page or post:
Replace the ID shown in the snippet with the ID of the post or page you want to remove.
Compatibility: WordPress 4.0 and Jetpack 3.3
48. Truncate Post Title
The following snippet controls the maximum title length. Add the following snippet in functions.php. Then use the function customTitle() in the template to output the title in place of the WordPress the_title() method.
If you build a WordPress theme with a tiled layout where the tile height has to be equal, you might want to specify the limit of the title length. This snippet should come in handy in that case.
Compatibility: WordPress 3.0
49. Remove WordPress Logo
WordPress 3.1 adds an admin bar, which includes a handful of links and the WordPress logo. If you are going to handout websites to a client and you want it to be brandless, here is the function to remove that WordPress logo.
function annointed_admin_bar_remove() global $wp_admin_bar; /* Remove their stuff */ $wp_admin_bar->remove_menu("wp-logo"); add_action("wp_before_admin_bar_render", "annointed_admin_bar_remove", 0);
Compatibility: WordPress 3.1.0
50. QR Code with Link to Article
Improve your website accessibility for mobile devices with QR codes. This code allows you to display QR codes with a link pointing to the article. Mobile users with a QR code scanner can obtain the article link for quick viewing on their mobile devices.