Allow users to give a dashboard widget a custom name using ACF

add_action( ‘wp_dashboard_setup’, ‘feed_dashboard_add_widgets’ ); function feed_dashboard_add_widgets() { $title = __( ‘My title’, ‘textdomain’ ); //by default title // if ACF is activated (prevent fatal) end your field not empty, define a new $title if ( function_exists( ‘get_field’ ) && ! empty( get_field(‘my_widget_name’ ) ){ $title = get_field(‘my_widget_name’ ); } wp_add_dashboard_widget( ‘dw_dashboard_widget_feed’, $title, ‘my_cool_widget’); }

How to enable [archives] short code

I don’t know or understand why, but I pasted this into wp-content/themes/twentysixteen/functions.php and it worked: function wpse61674_archives_shortcode_cb( $atts ) { return ‘<h2 class=”widget-title”>Archives</h2><ul>’.wp_get_archives(array(‘format’=>’html’,’echo’=>false,’type’=>’yearly’)).'</ul>’; } add_shortcode( ‘archives’, ‘wpse61674_archives_shortcode_cb’ ); I found this code somewhere on the internet, but it wasn’t part of the wordpress documentation on archives shortcode.

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