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

How do I display a tag cloud with both post tags AND a custom taxonomy?

The following is a slightly modified version of the wp_tag_cloud() function: function custom_wp_tag_cloud( $args=”” ) { $defaults = array( ‘smallest’ => 8, ‘largest’ => 22, ‘unit’ => ‘pt’, ‘number’ => 45, ‘format’ => ‘flat’, ‘separator’ => “\n”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘exclude’ => ”, ‘include’ => ”, ‘link’ => ‘view’, ‘taxonomy’ => ‘post_tag’, … Read more

How to load plugin before the wordpress jquery?

1.0.0? Really?! Anyway you could try the print_scripts_array filter: // Hack of wp_prototype_before_jquery() in “wp-includes/script-loader.php” function wpse157295_print_scripts_array( $js_array ) { if ( false === $jquery = array_search( ‘jquery-core’, $js_array, true ) ) // Now ‘jquery-core’, not ‘jquery’ return $js_array; $keys = array( ‘jquery.min’, ‘highcharts’, ‘exporting’ ); foreach ( $keys as $key ) { if ( … Read more

show limited tags in an article

Your code with changes: <?php $post_id = get_the_ID(); $queried_post = get_post($post_id); $user_info = get_userdata($post->post_author); // <– or: $user_info = get_the_author_meta(‘ID’) $first = $user_info->first_name; // what if it is empty or contains forbidden characters? $last = $user_info->last_name; // as obove wp_set_post_tags( $post_id, $first, true ); // <– tag slug, used in the code below // — … 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