Category: Code Snippets
-

Disable Comments For Link And Quote Post Formats
[ad_1] WordPress introduced Post Formats with version 3.1. A Post Format is a piece of meta information that can be used by a theme to customize its presentation of a post. By default WordPress comes with number of standard post formats but themes are not required to support every format on the list. Support for…
-

Disable Storing IP Address in WordPress Comments
[ad_1] While posting a comment, WordPress automatically stores commenter’s IP address along with other information in MySQL database. Storing IP address is useful when you want to identify comment author for any unlawful/illegal content or a comment spammers to prevent them for posting anymore spam comments. Although this is a useful feature but in some…
-

Prevent Direct Access to Functions.php in WordPress
[ad_1] WordPress plugins and themes are usually loaded and executed along with the rest of WordPress. However, since each plugin and theme is physically located on your server in wp-config folder, it is also possible for someone to bypass the normal load order and execute the PHP files directly. They just need to type the…
-

Display Custom Post Types in Recent Posts Widget
[ad_1] WordPress comes with a number of default widgets which allow blog owners to easily add some basic features to their website and one of them is Recent Posts widget. This particular widget, as the name suggests, displays a number of most recent blog posts in WordPress widgetized sidebar. It’s very easy to use, simply…
-

Send Email Notification to User on Profile Updates
[ad_1] On a project, I had a request from client who wants WordPress users to be notified by email when they update information in their user profile. I think its fair because most of the websites sends an automatic email notification when a user updates his profile and it’s good for security reasons too. But…
-

Automatically Highlight First Paragraph of Post Content
[ad_1] You might have noticed this on some websites that they highlight first paragraph of the article slightly different than the rest of the content. Some website use larger font size for first paragraph, some make it bolder than the subsequent paragraphs and some change the color style of the text. It looks nice and…
-

Change Submit Button Text in WordPress Comment Form
[ad_1] Comment system is an integral part of WordPress and that’s why we are always looking for ways to customize WordPress comments. In earlier articles, we have already seen how to use circular shaped avatars, change reply link text in threaded comments, highlight post author comments and how to automatically link twitter username in comments.…
-

Keep Users Logged in For Longer in WordPress
[ad_1] By default WordPress keep users logged in for maximum of 48 hours before logging them out or if they chose to close the browser before. If you click on “Remember Me” checkbox on the login page of your website, WordPress will keep you logged in for 14 days before logout and require you to…
-

Add Nofollow Attribute to All Links in a Specific Category
[ad_1] Adding the html attribute rel=”nofollow” to a link effectively stops Google and some other search engines to follow the link and prevent our website from passing page rank or recommendation to them. So adding the nofollow attribute to certain hyperlinks is good for SEO. Specially affiliate links, marketing link, paid links, links within blogrolls…
-

Create Post Navigation Like Dribbble in WordPress
[ad_1] Dribbble is a community of web designers & graphic designers share small screenshots (shots) showcasing their work on current projects. It’s a well known source for design inspiration. If you visit dribbble regularly then you might have noticed the unique navigation system dribbble use to browse through shots. dribbble use two small image thumbnails…