Changing excerpt length and “read more” link is a pretty often request. Here are the function that will allow you to change both of them. Add the code to the functions.php file.
WordPress
How to extend body_class function – detect version of Internet Explorer
These are very useful pieces of code. This code will allow you to add top level page class to the body tag. With this one you can easily detect browser (even version of Internet Explorer). Add the snippets to the functions.php file.
How to create custom login page
Customizing WordPress login page is a pretty easy issue. We just have to hook our code into login_head function. Here is how to do it: The first create custom-login.css: Then place this code into the functions.php file. When you hover over the WordPress logo of the login page, you’ll see that it links to official [...]
Display random background on each page load
A client asked me to implement function that allows to change background image randomly after each refresh. After some time of messing with rotation scripts I decided to create something myself. Here is my solution. The first we have to prepare CSS. We will use an image with fixed position and 100% width and height. [...]
“Briefly unavailable for Scheduled maintenance. Check back in a minute.” Solution.
Have you been updating your WordPress CMS or plugin and got stuck on “Briefly unavailable for Scheduled maintenance. Check back in a minute.” message? Here is a solution. Go to the wp-settings .php in the root folder of your WordPress installation and comment out line 50 like this: Refresh your site
How to allow contributors to upload files
Sometimes you need allow contributors to upload files. Here is how to do it: The lines must be added to functions.php.
Display recent and related posts without duplicating each other
My client asked me to implement lists of recent and related posts below a single post without duplicating each other. What do we have to do? Create 2 instances of WP_Query class ($recent_query and $tags_query) By the help of these instances we have to create loops for recent and related posts IDs of the recent [...]
Advanced Videobox
With this plugin you can add videos to your sidebar (or any other widgetized area of your site). Just copy and paste code of the video into the Advanced widget. The Youtube’s original video code doesn’t pass W3C validation. The filtered video code of the Advanced Videobox will keep your site XHTML valid. Of course [...]
Youtube Video Box Plugin
With Youtube Videobox plugin you can add unlimited number of videos to your site in a painless way. All you need is to copy and paste code of the video into the Youtube Videobox widget. The original video code from Youtube doesn’t pass W3C validation. My filtered video code will keep your site XHTML valid. [...]
Display current logged in user
1. If you are logged out you will see “Please log in or Register” else if you are logged in 2. you will see “Welcome USERNAME”