Have you ever wanted to change you boting gray default gravatar to something more catchy? Here is a code that implements your own avatar image. Just copy and paste it into functions.php. Don’t forget to name your new avatar image custom_avatar.gif. Now you can go to your admin panel Settings->Discussion and change the icon of [...]
How to display external RSS feed
Don’t mess with RSS plugins! Here is a snippet that displays any external RSS feed you want. This code display last 8 posts from SramekDesign in a list of links to the posts.
Custom excerpt length and more tag
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.
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.
jQuery link nudging script
My clients love when everything is moving upside down, from left to right and back. This script implements nice effect so-called link nudging: Of course, this script requires jQuery loaded previously. Put this code between HEAD tags: If you want to implement jQuery into WordPress CMS do it like this:
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 [...]