How to create a functions.php in child theme? [closed]

You need to remove the space between <? and php at the very start of your file. Incorrect: <? php add_action(‘iphorm_post_process_1’, ‘mytheme_create_wp_post’, 10, 1); function mytheme_create_wp_post($form) { Correct: <?php add_action(‘iphorm_post_process_1’, ‘mytheme_create_wp_post’, 10, 1); function mytheme_create_wp_post($form) { This is causing a simple syntax error.

How do I call a function to use on a page?

Looking at the code it’s not a function, it’s a method of CommentRatingFieldPlugin class, instance of which is being assigned to $crfp global variable. So your should be something like: global $crfp; $crfp->DisplayAverageRating();

Turn get_posts as string into an array for use in theme admin options

This… array(’54’=>’Post #1′,’23’=>’Post #2′, ‘654’=>’Post #3′,) … is not a string. It is an array definition. All you need to do is create an array, which is what you want, and skip the string completely. function post_page_options(){ $post_page_options = get_posts(‘category=orderby=title&order=asc&numberposts=”); foreach( $post_page_options as $value ) : $str[$value->ID] = $value->post_title; endforeach; return $str; }

Do not show on homepage functions.php code needed

I don’t think your code should work. You have to add_action to some hook (this function takes at least 2 params and you only use one of them). add_action( $tag, $function_to_add, $priority, $accepted_args ); Also there is no script called float-left-right-advertising registered by this plugin. Something like this, on the other hand, will work: function … Read more

Question about “wp_deregister_script()”

The reasons behind this is that these developers are doing_it_wrong. You should never deregister the core version of jQuery and here is why. However wp_deregister_script has its place, for example in child themes when you want to deactive a script or enqueue your own script instead.

Adding an option to a shortcode

Regarding Edit #3 I would rewrite it like this: //* Shortcode for getting users function list_of_users( $atts ) { extract( shortcode_atts( array( ‘display’ => ‘all’, ‘user’ => ’30’ ), $atts )); $content=””; switch ( $display ) { case ‘all’: $content = display_all_users(); break; case ‘single’: $content = display_single_user( (int) $user ); break; default: break; } … Read more

the_password_form functions not working together

You have to control the order of execution. To do that, use the third parameter for add_filter(), the priority. A higher priority equals to later execution. add_filter( ‘the_password_form’, ‘my_password_form’, 9 ); add_filter( ‘the_password_form’, ‘wpse_71284_custom_post_password_msg’, 10 );