All Questions (5,616 questions)



How to reorder meta box position in WordPress?

Posted by Prem Tiwari | Updated on

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

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

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

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

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

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

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

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 …

What is a final keyword in PHP and when it is used?

Posted by Prem Tiwari | Updated on

The final keyword in PHP is used to mark either a class or a function as final. If a class is marked as final, it cannot be extended to use its properties or methods. It …

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

Posted by Prem Tiwari | Updated on

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

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

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 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

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

This the post__not_in arg should work dandy for you: