How to develop an extension for a simple form post and post back? [closed]

I think the easiest way is adding the form via the Shortcode API. The code would look like this: function myform_handler( $atts ){ if (isset(@$_REQUEST[‘submit’])) { //Do something } else { $return = ‘<form action=”” method=”post”> <input type=”text” name=”myfield”> <input type=”submit” name=”submit> </form>’; } return $return; } add_shortcode( ‘myform’, ‘myform_handler’ ); Then you can add … Read more

Hide widget on page

You can use this snippet. Just make sure you change the widget id : <?php add_filter( ‘widget_display_callback’, ‘widget_display’, 50, 3 ); function widget_display( $instance, $widget, $args ){ if ( is_page() && $widget->id == ‘text-39’ ) { return false; } return $instance; } ?> The easiest way is to use a WordPress plugin though. There are … Read more

How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

Neither wp_enqueue_style() nor wp_register_style() have a parameter to allow them to be loaded in the head, rather than the footer, as their script counterparts do. The only solution is to have some of your CSS (or all of it – which would be bad) inside a style tag inside head, added with the wp_head action … Read more