How can i force wp-admin to use 2-column dashboard layout? [closed]

This should help: function so_screen_layout_columns( $columns ) { $columns[‘dashboard’] = 2; return $columns; } add_filter( ‘screen_layout_columns’, ‘so_screen_layout_columns’ ); function so_screen_layout_dashboard() { return 2; } add_filter( ‘get_user_option_screen_layout_dashboard’, ‘so_screen_layout_dashboard’ ); On dashboard screen options it will show 1 or 2 columns, after clicking 1 column after refresh will still be 2 columns. You can change to whatever … Read more

Allowed memory size exhausted problem

The problem is that you don’t have enough memory allocated for your php script in your php.ini file. there are two ways to solve it increase the memory allocation which might require you to increase the actual physical memory you use give up on some features of your site. There is no one root cause … Read more

WordPress function only executes once

It will be bit tricky to detect if user just get into site. But generally there will be no referer, hence wp_get_referer() will return false. My code check if there is referer, if no then they get redirected to post page. NOTE: When user access a page in admin by typying url in adressbar then … Read more

Dashboard Widget CSS

You could use postbox_classes filter as follow: add_filter( ‘postbox_classes_dashboard_widget2’, function ( $classes ) { // $classes is an array; add your custom classes to the array $classes[] = ‘my-class’; return $classes; } );

How to activate the dashboard

Go to your domain and type /wp-admin and log on with your username and password. http//www.yourdomain.com/wp-admin Then go to appearance, themes and then activate your theme. If it’s not already installed you can either drag your theme to the wp-content/themes folder or install it from within the themes area.

How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?

Add following code in your theme’s functions.php. // To add extra column in column headers add_filter(‘manage_posts_columns’, ‘bs_event_table_head’); function bs_event_table_head( $defaults ) { $defaults[‘pending_comments’] = ‘Pending Comments’; return $defaults; } // To add data in column for each post. add_action( ‘manage_posts_custom_column’, ‘bs_event_table_content’, 10, 2 ); function bs_event_table_content( $column_name, $post_id ) { if ($column_name == ‘pending_comments’) { … Read more

Why do get_category_by_slug() crashes WordPress 4.8

Because get_category_by calls get_term_by which calls get_terms which creates a WP_Term_Query which runs the list_terms_exclusions filter, which runs your code that calls get_category_by which calls get_term_by which calls get_terms etc etc etc Your problem is that of an infinite loop, the functions you call in your filter, trigger the filter they’re called in. It’s not … Read more

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