Language Switch Function

You are now only testing for the theme location not to be empty. This means that every non empty menu location will see the language button attached. So, in stead of testing for emptyness you should be testing for a specific location. The name of that location depends on your theme, but suppose it’s called … Read more

Keep js after reload the page

I understand, that you want “a.music” remain set active after you reload the page. For that you can check whether the cookie is set or not if it is set you make active to the “a.music” else it will remain as same. var tags = getCookie(‘tags’); jQuery(‘a.music’).each(function(){ var dTag = jQuery(this).attr(“data-tag”); if(dTag == tags) { … Read more

Custom shortcode with do_shortcode and substr

using php substr requires you add a start point when calling substr function http://php.net/manual/en/function.substr.php A possible fix: function my_shortcode_function() { $string = “”; $string = do_shortcode(‘[different_shortcode]’); $string = substr($string, 0, 4); return $string; } add_shortcode( ‘my_shortcode’, ‘my_shortcode_function’ );

Translation Function missing text-domain [closed]

From WordPress Codex (Link): <?php $translated_text = esc_attr_x( $text, $context, $domain ) ?> The $domain is optional. That´s the reason it´s a warning. Do you have debug set to true? If you want to fix it you have to add the text-domain. esc_attr_x( ‘Search for:’, ‘label’, ‘TEXT-DOMAIN-FROM-THEME’ ) You can find the text-domain in other … Read more

wordpress ajax is not working for dropdown selection

The first issue I see is the ajax url is incorrect. Your wp_localize_script() has the handle name ‘main’, not ‘ajax_object’. url: main.ajaxurl Also, where is the callback code to handle the get_program_by_category ajax action? You’re missing two actions. add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_action’, ‘my_action_callback’ ); See the WordPress Codex to learn more about using … Read more