Adding theme option values as custom body class

Review how the variable scope works.. Let’s not add yet another global variable, instead we can e.g. fetch the option values within the filter’s callback: function wpse251261_custom_body_classes( $classes ) { // Get option values $rounded_corner_radio = of_get_option( ’rounded_corner_radio’ ); $gradient_radio = of_get_option( ‘gradient_radio’ ); // Assign new body classes $classes[] = esc_attr( $rounded_corner_radio ); $classes[] … Read more

the_content() Not Grabbing All Content

Try calling the_post() at the top of the file before calling functions like the_title() and the_content() If that doesn’t work, then most likely you have a function on the the_content filter that is causing this problem. Try disabling the plugins you have installed one by one to see if that fixes the problem

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

call_user_func_array() expects parameter 1 to be a valid callback, function ‘———-‘ not found or invalid function name

Like your previous questions answer if you have called any class method you need to reference the class. So you need to replace this line $theme_options = $mafongroup_menu_page_creation_method( $page_title, $menu_title, $capability, $menu_slug, $function,’dashicons-image-filter’, ‘2.111111’); With this one- $theme_options = $mafongroup_menu_page_creation_method( $page_title, $menu_title, $capability, $menu_slug, array( $this, $function ),’dashicons-image-filter’, ‘2.111111’); So your above code will be … 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