Shortcode to insert menu in page body?

That code should work. Are you usign “myclass” as the class and not “.myclass”? Is this for a specific use where class will always be the same? If you’re only looking to ever use this on one place, you can do this: function print_menu_shortcode($atts, $content = null) { extract(shortcode_atts(array( ‘name’ => null, ‘class’ => null … Read more

Call to undefined add_action() in theme’s functions.php

register an ajax action for submitting email: Note handle_form is the name of your action in this example add_action(‘wp_ajax_handle_form’,’handle_form_submit_111605′ ); also add this in order to make it work for non logged in users add_action(‘wp_ajax_nopriv_handle_form’,’handle_form_submit_111605′ ); do validation and mail sending job in the callback function handle_form_submit_111605 In functions.php function handle_form_submit_111605() { } User simply … Read more

Enqueue Style in Functions.php

Your problem is that you have wrapped your complete function and your action inside your conditional check. Your conditional check for your page template should be in your function. Page templates gets set quite late, too late for your action. Your function should look like this function flatsome_scripts() { if( is_page_template( ‘template-flat.php’ ) ) { … Read more

I created a child theme and it doesn’t work for some of the css files

You are calling your css files with wrong function like in following line of your code wp_enqueue_style( ‘parent-style’, get_directory_directory_uri() . ‘style.css’ ); You are using get_directory_directory_uri() function to call files which is not event a function in wordpress. Files must be called with one of the following two functions get_stylesheeet_directory_uri() : This function will search … Read more

Remove Menu Page Giving Error

Put the add_action line inside the if (!current_user_can(‘activate_plugins’) ) {: <?php /************ Remove admin menu items from anyone who isn’t an admin ************/ if (!current_user_can(‘activate_plugins’) ) { function my_remove_menu_pages() { remove_menu_page(‘link-manager.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘edit-comments.php’); } add_action( ‘admin_menu’, ‘my_remove_menu_pages’ ); }; ?>