Since WordPress 2.7, we can use sticky posts which keep posts at the top when going through the loop of posts. Even though the sticky posts were added way back in 2008, this feature still only works with built-in posts. With custom post types, it is currently not yet available. In this article, we will learn what sticky posts are, why they weren't added yet for custom post types, and how to make them stick anyway.
WordPress - Tips & Tricks
When developing for WordPress locally on Windows, we need to have Apache, PHP and MySQL installed. There are web development environments available such as EasyPHP or WampServer, but I always prefer to install them manually. The experience you gain from it becomes useful when you encounter a problem with either PHP, Apache, or MySQL database as you will have a better idea where to look for the issues.
To set the language direction of the content in the element, we use either the HTML dir attribute or CSS direction property. The default value is ltr (left to right direction), while languages like Arabic and Hebrew use rtl (right to left direction). Sometimes, we might want to change the value of the current direction and this is the focus of this article.
Shortcodes are a very popular feature in WordPress that allows you to add custom functionality to the content. WordPress also has some built-in shortcodes on its own. They are very easy to use inside the posts or pages and they even work inside the Text Widget. But they won’t work when they are added in an excerpt or a custom field. This article will show you how to use shortcodes in those cases too.
There are many WordPress plugins for highlighting programming code. Until now, I have used Crayon Syntax Highlighter on this blog and was satisfied with it, but at the time of the writing, the plugin was last updated more than 2 years ago, so I started looking for the non-plugin alternative. In the end, I chose to use Google code-prettify library. This article will show you how to implement this library into the WordPress and how to make it more versatile by using few CSS tricks.
Recently I was thinking of ways to get more comments on my WordPress blog and one way to achieve that could be making email field optional instead of required as some visitors might be unwilling to share their email just to drop a comment. It turns out this is not as easy as it sounds. It seems the WordPress has Name and Email tied up as you can only make either both optional or both required. This post will show you, how to make email an optional field while leaving name field required.