Auto Installing Plugin on Theme installation

In some case WordPress theme needs to auto install plugin that is a hard dependencies to their theme, They can try to use the TGMPlugin installation class to help in notifying user that a plugin needs to be installed in order for the theme to work perfectly, But sadly the class won't provide "fully automatic"  installation process.

So is it that hard to tell WordPress to auto install a plugin from theme?

WordPress - Multiple Pager in a single page

WordPress offered us as a developer function to create pagination easily by using the Paginate_links function. One just need to provide the function with configuration arguments array and voila... pager is built.

WordPress - Creating Custom Post Type Without Title

It is very easy to create a new post type in WordPress, you just need to call the register_post_type() function with all of it's configuration array and the post type will be visible and ready for use.

But if you choose not to utilize the default "title" in the register_post_type() arguments then most likely all of the newly created post under the custom post type will be give "auto-draft-xxx" as it's post title and post name.

jQuery - Loading and unloading CSS script dynamically

Why to do this?

It may be a strange to hear when someone wanted to load a CSS file dynamically or even try to unload it.

Sure you can use jQuery to style the elements by adding inline styling, and removing the inline style using jQuery is not hard to do either.

Wordpress - Limiting Media to owner only

Wordpress Media manager is a very good tools, but it was designed to act as media pools for all user in the site, sometimes we want to limit the media displayed in Media uploader to show only the media that current user actually owned.

In that case we will need to add a filter to wordpress query, an additional sql query limit that will limit the searched data for media file owner only.

We can add a new filter by invoking the filter 'parse_query' like this :

Wordpress - Registering Custom Taxonomy Programmatically

It is possible to register custom taxonomy in wordpress programmatically by utilizing the register_taxonomy() function, it can be done from widgets, theme or plugins.

The key is to invoke the function in wordpress init hook, so it the custom taxonomy will be registered before other function that may call or use it later on.

Sample of hooking into wordpress init hook :