Tag: functions.php

How to enable comments for all posts in wordpress

I had a problem with my blog recently that some plugin was disabling comments for older posts. Editing one-by-one and enabling comments back is a pain i know. Here is a simple function you can put in your functions.php to enable comments for all posts at once.

HowTo: Use shortcodes in your theme files

Altough shortcodes are made to be used in post content, you can sometimes need it’s functionality in your wordpress theme designs. Here i will show you how to easily use any shortcode in your page templates.

HOWTO: Add script to your theme using wp_enqueue_script

TO add a javascript file to your theme its easy to use header.php in your theme folder. However if there are plugins using same script libraries (like jquery, scriptaculous ) it may cause errors. Here i will show you how to add javascripts to your theme in a safe way using wp_enqueue_script.

How to change WordPress default embed size using filters

Embedding videos from video sites to your posts is a very simple task in WordPress. You can easily embed videos just pasting URL of the video to your posts. It automatically displays the video depending on your media settings. What if you wanted a different video size in single posts?

Enabling shortcodes in widgets

Shortcodes make life easier for a blogger. I can easily list subpages, add post meta elements and even query posts using shortcodes. You can do as much in your widgets too, you just need a quick fix to enable shortcodes in your widgets.

How to disable wordpress admin bar

WordPress 3.1 brings a new feature called wordpress admin bar. That’s a bar displayed on top of your site when you log in and it gives you quick access to general admin actions. I’m sure they will add an option to hide it soon. Until then, here is how to hide it manually.

How to change HTML editor font in WordPress

As a developer, I prefer writing my posts in HTML editor. It is strange, but TinyMCE HTML editor doesn’t use monospace fonts. Here i will show you how to insert our own CSS styles in WordPress using theme functions file.

How to change dropdown menu depth and order using filters

With the 1.5.8 release, I added dropdown_menu_defaults filter to the dropdown menu widget, so anyone can edit dropdown menu defaults so easily. Here in this post I will show you how to change depth and page order using this filter.

How to hide members only content in your posts

In wordpress there are many ways to hide your members only content. You can either install a plugin to hide your posts, or you can create password protected posts that only members can access. But there is another way; Shortcodes. Here i will explain you how to hide members only content in an easy way..

Advanced adsense targeting for wordpress Pt.2

In the first part, Advanced adsense targeting for your post content Pt.1, I explained you how to wrap your post content with targeting tags automatically using wordpress filters. In the second part i will show you how to exclude certain parts of your posts from ad targeting.