call_user_func_array() expects parameter 1 to be a valid callback, function

You have to change this add_action(‘admin_menu’,’mafongroup_admin_menu’); to add_action(‘admin_menu’,array( $this, ‘mafongroup_admin_menu’ ) );. Cause you’r here calling a class method. So you’ve to give reference to the class. And also if you put public before declaring mafongroup_admin_menu() function, it would be more readable and would be helpful in future I think. See the updated class code … Read more

Shortcode question

Why not like this: //function to generate error messages for bid form function generate_error_msg($type, $message){ global $error_msg; if($type == “success”) { $error_msg = “<div class=”success”>{$message}</div>”; } else { $error_msg = “<div class=”error”>{$message}</div>”; } } //Creates table, displays and validates bid form, and inserts valid bid data into table. function bid_form_display(){ //$error_msg = ”; global $wpdb; … Read more

Fatal error: Call to undefined function is_even()

That’s because the is_even function isn’t defined. You can either make sure it’s defined in the themes function or replace it: To replace it, you can use $style = ( $blog_count % 2 ) ? ‘even’ : ‘odd’; or define the is_even funtion function is_even( $blog_count ) { if ( $blog_count % 2 ) return … Read more

Add element to widgetpage

You can use @kudratullah’s suggestion to hook into the widgets page. The downside is that this allows insertion of a piece of html only in one specific place. If that location is ok, use that solution. Otherwise, there are two other possibilities. The first is to use jquery. Examine the source to identify the html … Read more

Get term slug by term id and then explode it

I guess the problem is here. $slug = $term->slug; $explodedSlug = explode(‘-‘, $_slug); you are passing an undefined array $_slug to explode function. the correct array is $slug. so your complete code should be something like below. function revised_featured_courses_query() { $meta_query = WC()->query->get_meta_query(); $tax_query = WC()->query->get_tax_query(); $tax_query[] = array( ‘taxonomy’ => ‘product_visibility’, ‘field’ => ‘name’, … Read more

Child theme function.php causes fatal error

This is because the same function exists in the parent. archi_theme_setup() Since you are under the same namespace there will be a name collision — PHP cannot hold two functions with the same name. When you set the child theme as the active one child theme functions.php will load first and then the other one … Read more

Need help with customalert that it would read on a normal page, but not in WordPress

It seems that some elements that you’re referencing to on your JavaScript, do not exist by the time you execute the code. Elements that should exist before the JavaScript: dialogoverlay dialogbox dialogboxhead dialogboxbody dialogboxfoot Based on the error message, these elements DO exist: dialogoverlay dialogbox A few questions to clarify Did you check if the … Read more