Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control

If the setting and controls are added exactly as they appear in class-wp-customize-manager.php the JQuery script in wp-admin/custom-header.php will toggle the header text color control properly. The theme_supports line must be commented out or removed as it is “used to hide a setting if the theme lacks support for a specific feature”.[1] add_action( ‘customize_register’, function … Read more

How do I list the child of a child page [duplicate]

First of all, why you are querying for posts by your custom query? We have WP_Query class and get_posts function to do this. $child_pages = $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_parent = “.$post->ID.” AND post_type=”page” ORDER BY menu_order”, ‘OBJECT’); became $pages = get_posts(array( ‘post_type’ => ‘page’, ‘orderby’ => ‘menu_order’ ‘order’ => ‘ASC’ ‘posts_per_page’ => -1, … Read more

How to put a variable in a instance in the widget

As far I understood you want to assign the order number like $order_number = order_generator($email) inside the widget class. Yes, you can do it that way unless the order_generator is in another class. If you order_generator function is in another class then first you need to instantiate the class then call the method like $instance_of_your_class->order_generator($email). … Read more

Cannot display or echo alt text on featured image

I am not so sure of what I am going to say, but from a fast look, $featured_image is an array (URL, width, height, is_intermediate). so assuming that your alternative text exists in this array, you need to specify its index like this: $featured_image[index_of_alt_text] according to my understanding, the $featured_image array doesn’t contain your alternative … Read more

Using foreach loop breaks

I believe your issue is with $vals=get_post_meta($post_id, $key2, true); If you check the codex, the last parameter for get_post_meta is whether to return a single value or array of values. You have set it to true which means return only one value. Try it with false (the default) it should work.