Add custom fields to a page template, admin side

You can do this via JavaScript rather easily. Here are the steps you need to take. I’ve created a sample (untested) script below as a proof-of-concept for you. Register your meta box add_action(‘add_meta_boxes’, ‘foo_page_template_meta_box’); function foo_page_template_meta_box(){ add_meta_box( ‘foo_page_template_options’, __(‘Foo Page Template Options’), ‘foo_page_template_options’, ‘page’ ); } function foo_page_template_options(){ //Your custom field form goes here } … Read more

Contextual help in wp-admin for non admins

The contextual help code doesn’t make any discrimination on user-level by default. If you can see the page, the contextual help is there too. Are you using some custom code, and hiding the help stuff behind a level check, by chance? More information than what you have provided is needed.

Issue with checked() echoing on to page

By default, checked echoes. If you set the (currently empty) third parameter to false, it should work as expected. Change the line to: $$sku = isset( $instance[$sku] ) ? checked( (bool) $instance[$sku], true, false ) : false; More info: http://codex.wordpress.org/Function_Reference/checked

Change Default Content when Creating a Post based on Previous Category Choice

You should have linked to the original Q&A since the beginning… Another great code from @JanFabry, btw 🙂 Force category choice before creating new post? Using exactly the code provided in his answer, this is how to make the filter default_content work: add_filter( ‘default_content’, ‘wpse_71772_default_content’, 10, 2 ); function wpse_71772_default_content( $content, $post ) { if( … Read more

Publish page by invoking submit via jQuery

Trigger the click event of the publish button instead, and let WP do the work. <script> jQuery(document).ready(function( $ ) { $( “#secondary-publish” ).click(function () { $( “#publish” ).click() }); }); </script> Don’t use language (it was deprecated in HTML 4.01!) – you can drop type too (WP now has an HTML5 doctype).

Sorting custom post types in edit.php : Post disappear

The problem is ‘meta_key’ => ‘large_feature’, in your last function, here the “large_feature” is a taxonomy, not a “meta_key”. Infact there is no post in wordpress which has “large_feature” as a “meta_key”. That’s the reason wordpress didn’t display any posts. About ordering by taxonomy terms, wordpress doesn’t allow that like this. You can however customize … Read more

WordPress admin right sidebar isn’t working

I saw this with an older version of WordPress. I have not seen it with more recent updates. You fix is to update, honestly. This should be the least of your reasons to do so. Without updating, the only way I was able to sort it out was by editing the (if I remember correctly) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)