How to show an error message after publishing a post?

I wouldn’t use that hook. Here’s why Try something like this using admin_notices. function wpsites_admin_notice() { $screen = get_current_screen(); if( ‘post’ == $screen->post_type && ‘edit’ == $screen->base ){ ?> <div class=”error”> <p><?php _e( ‘Updated Demo Message!’, ‘wpsites’ ); ?></p> </div> <?php }} add_action( ‘admin_notices’, ‘wpsites_admin_notice’ ); Untested.

How do I fix this error: Warning: invalid argument supplied for foreach()?

This usually happens when you are trying to do admin navigation stuff and you aren’t hooked into admin_menu. If you hook in before that, $menu hasn’t been created yet. add_action(‘admin_menu’, ‘my_plugin_add_menu’); function my_plugin_add_menu(){ $ptype=”my_post_type”; $ptype_obj = get_post_type_object( $ptype ); add_submenu_page( ‘my-menu-item’, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, “edit.php?post_type=$ptype” ); }

How can I fix those issues generated by the Themecheck plugin

Registering custom posts is a plugin territory. It means that you need to remove them from the theme’s functionality and register them via a plugin (usually recommended when installing the theme using TGM Plugin Activation or something else). Here are the recommendations of the Theme Review Team. Themes must not incorporate the following, Plugin-territory functionality. … Read more

When importing database, it shows error

This issue is as a result of your server not supporting the utf8mb4_unicode_520_ci collation type. To resolve this you should convert the collation for all tables with utf8mb4_unicode_520_ci to utf8_general_ci If you’re exporting through phpmyadmin, you can: Click the “Export” tab for the database Click the “Custom” radio button Go the section titled “Format-specific options” … Read more

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