How do I use a custom theme for the WP Maintenance Mode plugin?

How to do this is on the front of the plugins wordpress.org page. http://wordpress.org/extend/plugins/wp-maintenance-mode/ You can add your own html and stylesheet and add the url of this style to the options of the plugin. Write your style to this markup and upload to the webspace; after add the url include http:// to the settings … Read more

I want to reset user’s post meta after successfully login

wp_login action passes 2 arguments $user_login and $user. The second argument is the object of WP_User class, which you can use to get user id from: function reset_dismiss_message( $user_login, $user ) { update_user_meta( $user->ID, ‘tgmpa_dismissed_notice’, false ); } add_action( ‘wp_login’, ‘reset_dismiss_message’, 10, 2 );

Plugin code will not work properly inside a class [closed]

Enable the magic method __construct You have to change the following line $MySubBoxClass = new MySubBoxClass; Into $MySubBoxClass = new MySubBoxClass(); This way the __construct() magic method will be used. The add_action methods aren’t called now. Error in html_form_func( $object ) Change public function html_form_func( $object ) //Creates the HTML form and outputs its value … Read more

Widget where it can make changes to the container

I would not recommend that. Much easier to use a clearfix hack to force clearing and just add that style to your widget. Clearfix hacks are transparent: it doesn’t matter if they happen on all elements there is no visible difference, other than clear floats. Somewhere in your themes style.css: .widget:before, .widget:after { content: ” … Read more

Get variable value based on string constant

You can do that, but you shouldn’t: Keep the global namespace clean. Each name in the global namespace is a collision candidate. Making a variable global, a constant or a function increases the likelihood of a collision, no matter how good your prefixes are. Constants are the slowest global types. Yes, that’s micro-optimization, but why … Read more

force jQuery to load in the head

Edit: new solution, based on one of the comments. If you are using wp_enqueue_script to load your js file, make sure jQuery is a dependency so that it gets called before your code: wp_enqueue_script( ‘my_script’, ‘my-script.js’, array( ‘jquery’), $ver, true ); You can then remove the original enqueue call you had since jQuery will be … Read more