How to reorder meta box position in WordPress?

Posted by Prem Tiwari | Updated on | WordPress


How to reorder meta box position in WordPress. In the following example, replace CPT with the post type name, like post, page, book, event, imaginary, foobar…

Showing Meta Box via Jquery Checkbox

Posted by Prem Tiwari | Updated on | WordPress


Showing Meta Box via Jquery Checkbox. I found this solution to it though, pretty simple. See the below example:

How to lock meta box position on post edit screen for contributors?

Posted by Prem Tiwari | Updated on | WordPress


How to lock meta box position on post edit screen for contributors. Found this while trolling the internets… Works Perfectly

How to disable sticky posts feature in WordPress?

Posted by Prem Tiwari | Updated on | WordPress


How to disable sticky posts feature in WordPress. The best and most optimal solution is to simply “ignore” sticky posts on all queries which can be done with this code:

How to disable the “remember me” to wp-admin in WordPress?

Posted by Prem Tiwari | Updated on | WordPress


How to disable the “remember me” to wp-admin in WordPress. You can do it with JavaScript (jQuery) or outputbuffering. A combination of both (outputbuffering and JS) are in the script below. PHP Code

How to change the title url on the edit post screen?

Posted by Prem Tiwari | Updated on | WordPress


Use get_edit_post_link filter to change the title url on the edit post screen.

How to isolate code to the post edit screen

Posted by Prem Tiwari | Updated on | WordPress


Use the WP_Screen object to tell where you are at in the admin instead. Much more convenient. Note that you have to wait until at least the admin_head hook to run for the current screen …

Wp_Schedule_Event every day at specific time

Posted by Prem Tiwari | Updated on | WordPress


Wp_Schedule_Event every day at specific time WP Cron runs, when somebody visits your website. Thus if nobody visits, the cron never runs. Now there are 2 solutions: 1. Disable WP Cron, use a real cron …

How to retrieve all post titles of a specific post type?

Posted by Prem Tiwari | Updated on | WordPress


How to retrieve all post titles of a specific post type? Function that returns post titles from specific post type as form select element returns null if found no results.

Change Custom Post Type slug in WordPress

Posted by Prem Tiwari | Updated on | WordPress


Change Custom Post Type slug in WordPress. The register_post_type_args filter can be used to modify post type arguments:

Where does WordPress store version number?

Posted by Prem Tiwari | Updated on | WordPress


If you need to get the wordpress version in your script, there is a global variable: $wp_version (right now it’s something like ‘3.1-RC3-17376’) It contains the wordpress version. If you need to acquire if from a file, …

WordPress get all posts in RSS

Posted by Prem Tiwari | Updated on | WordPress


WordPress get all posts in RSS. Codex has example snippet on how to use post_limits filter to override amount set in admin for feed.

Add class to before_widget from within a custom widget

Posted by Prem Tiwari | Updated on | WordPress


Aha, so the $before_widget variable is a string representing div element: <div class=”widget my” id=”my-widget-1″> . So I checked the $before_widget for the “class” sub-string and added my $widget_width value to it. The code is from my custom widget file: I wanted to …

Exclude Current Post from Recent Posts Loop

Posted by Prem Tiwari | Updated on | WordPress


This the post__not_in arg should work dandy for you:

How can i limit the character length in excerpt?

Posted by Prem Tiwari | Updated on | WordPress


How can i limit the character length in excerpt. Add the below lines in your current activated theme’s function.php file.