Website Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘Wppr_Public’ does not have a method ‘amp_support’

The warning message is pretty clear. You’re passing method amp_support from class Wppr_Public as callback, but this class doesn;t have such method… So how to fix it? You should find that class and look for this function. Maybe it’s some typo or that method changed its name or moved to another class or something like … Read more

500 error after update

In phpmyadmin search : SELECT * FROM wp_options WHERE option_name=”template” OR option_name=”stylesheet” OR option_name=”current_theme”; then : UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”template”; UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”stylesheet”; UPDATE wp_options SET option_value=”yourthemename” WHERE option_name=”current_theme”; or if you want to go back to default (presuming some default exists) SET option_value=”default” WHERE option_name=”template”; UPDATE wp_options SET option_value=”default” … Read more

“Cannot modify header information” means I can’t use wp_redirect

As Milo stated, you can’t send header information after PHP has begun sending request response body. Redirects belong in a function hooked into wp_loaded to ensure they run before the request body is generated. You need something like the following in your functions.php file: function hook_wp_loaded_require_login() { $uri = ( isset( $_SERVER[‘REQUEST_URI’] ) ) ? … Read more

Updating posts exceeds maximum execution time

You do have a large amount of posts which will crash your server (due to maximum execution time being exceeded) with such an expensive operation. We will need to run this in a much more cleverer way. First of all, we would want to get all posts, except revision and nav_menu_item. Revision post_names are build … Read more

WordPress: Notice:Object of class WP_Query could not be converted to int in on line

Your problem is here: $featuredPosts = new WP_Query(); $featuredPosts->query(‘showposts=”.get_option(“mp_slides_no’).’&category_name=”.get_option(“mp_featured_cat’).”); for($i=1; $i<=$featuredPosts; $i++) { You’re creating a new instance of WP_Query to run a custom query and storing it in the $featuredPosts variable. But then you’re trying to use $featuredPosts as the upper limit of a for loop. This is what PHP is complaining about. Your … Read more

Declare Global Variable In OOP PHP

The $current_screen is passed as a variable to callables hooked from the current_screen hook. Before this hook, the $current_screen isn’t set up, so globalizing the variable won’t do anything anyway. Also, WordPress offers the convenience function get_current_screen() that returns the global $current_screen variable if it exists. class wpse { protected $current_screen; public function load() { … Read more

Error after moving WordPress installation

Is the site still working/displaying properly , other than this error on the front end? It looks to me like your new hosting environment has warning and notice reporting ON. Consider looking in your wp-config.php file for WP_DEBUG and make sure it’s set to false. Depending on how much control you have on your hosting … Read more

Display all WP Errors together during form validation

Sorry to bother . It was one of my other functions which was limiting the error to echo only once. Here is the previous code : function display_message( $message = false ) { if( is_wp_error( $message ) ) { echo ‘<div class=”error”><p>’ . $message->get_error_message() . ‘</p></div>’; } It worked fine when i changed it too … Read more

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