Sometimes while developing a resource on WordPress, we come across a particular situation like needing post specific data outside WordPress loop. Here is a small code snippet I usually use when I need to get a post’s excerpt outside the loop.
Most of us are comfortable with the HTML post editor on WordPress Edit Post or Add New Post screen. As we know the ‘Visual Editor’ is the default post editor for WordPress, but it sometimes adds non-standard code to the post’s HTML source or it also changes the post formatting that we have done thru HTML editor. So why not change this and set the HTML editor as the default post editor. This is a very simple tip…
The WordPress Visual Editor on the Edit Post screen is sometimes a real menace as it adds some formatting and removes the ‘div’ elements and sometimes paragraphs and classes automatically. It also adds some invalid HTML or what we can say non-standard code to our post’s HTML source. So in such cases, you definitely would want to disable the WordPress Visual Editor. There are two simple ways…
Consider, I comment on a WordPress blog and I just put the text as http://www.clickonf5.org/ as a reference site in the comment text. Note that I have not written the html to make it the link. But when the comment gets displayed on the post, this text automatically becomes a link which is clickable. Here is a one line code that will help you remove such automatic formatting and conversion.
If the post that you are writing is a longer one, you might want to insert or embed an adsense ad in between the content so that you can monetize your longer content. You can embed or insert different sizes of Google Adsense ad anywhere inside the WordPress post content without using any plugin, just a shortcode.
I tried to embed the Pac-Man Game on Internet Techies this morning, and to my wonders I was successful. You can play the game on this post, the complete source code is taken from Google homepage, and the game works same as that of the Google Doodle today . Enjoy and let your readers have some fun.
Here is the Wordpress function that you can use in your plugin or theme to get complete user information using his/her login username.
Here is a simple three line code to be added to your Theme Functions file to make all the comment links generated by comments_popup_link Wordpress Template Tag ‘no follow’ for the search engines like Google.
Here is a simple function to avoid Spam Comments entering in your Wordpress pending approval, approved or spam comment queue. This will prevent the automatic comment posting bots from posting the comments to your blog posts and pages.