Create a simple widget

The correct question would be “how to create a widget”? No code was initiated. I recommend reading this tutorial: Building Custom WordPress Widgets Anyway… your widget: class widget_simple extends WP_Widget { // Create Widget function widget_simple() { parent::WP_Widget(false, $name=”Custom Simple Widget”, array(‘description’ => ”)); } // Widget Content function widget($args, $instance) { extract( $args ); … Read more

wordpress widgets screen disappeared

This is both a change in WordPress core in 3.5, and a problem specific to your commercial Theme. In WordPress 3.5, if a Theme does not register support for dynamic sidebars (i.e. Widgets), then the WP-Admin does not display the Appearance -> Widgets admin page. So, if the behavior changed between WordPress 3.4 and 3.5, … Read more

Remove “Content” and “Discussion” from Right Now Dashboard Widget

Here are two methods: Method 1 You could remove the whole Right Now metabox from your dashboard: function custom_dashboard() { if(!current_user_can(‘manage_options’)){ // only remove it for non-admins remove_meta_box(‘dashboard_right_now’, ‘dashboard’, ‘core’); } } add_action(‘admin_init’,’custom_dashboard’); and then add another custom Right Now metabox with your custom code. You could for example check out the WordPress function wp_dashboard_right_now() … Read more

wordpress widget missing jquery

Your first two problems: $ and jQuery is not defined. $ is just an alias for jQuery. Your first two problems are the same with different names. I think you do not write a plugin or a function in your functions.php. I think you put your code simply in the template file and expect that … Read more

How to best include widget area just on homepage?

Is this expected behaviour? Yes, it is expected behavior. The genesis_register_sidebar() function is just a call to register_sidebar() with a few predefined defaults for $args and a filter named ‘genesis_register_sidebar_defaults’: function genesis_register_sidebar( $args ) { $defaults = (array) apply_filters( ‘genesis_register_sidebar_defaults’, array( ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”><div class=”widget-wrap”>’, ‘after_widget’ => “</div></div>\n”, ‘before_title’ => ‘<h4 class=”widgettitle”>’, … Read more

How to use get_results() in widget front end?

It seems that you can’t access to it. Please try add global $wpdb; to your function. UPDATE For reference, in WordPress Codex you will find: WordPress provides a global variable, $wpdb, which is an instantiation of the class already set up to talk to the WordPress database. Always use the global $wpdb variable. (Remember to … Read more

How to use the widget area to extend the page content?

Hook into register_sidebar and remove the sidebar from the global array $wp_registered_sidebars: add_action( ‘register_sidebar’, function( $sidebar ) { if ( ‘lateral’ === $sidebar[ ‘name’ ] ) unset( $GLOBALS[‘wp_registered_sidebars’][ $sidebar[ ‘id’ ] ] ); }); Then adjust the stylesheet or add extra CSS to wp_head to let the page content take the full width. See also: … Read more

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