Add array of category IDs to global variable?
Simple solution- use GLOBAL variables.. $GLOBALS[‘my_categories_list’] = array(1,2,3,4); then you can everywhere access $GLOBALS[‘my_categories_list’].
Simple solution- use GLOBAL variables.. $GLOBALS[‘my_categories_list’] = array(1,2,3,4); then you can everywhere access $GLOBALS[‘my_categories_list’].
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
For a one-time “patch” to update your database for word replacement, I find that this tool from interconnectit.com is excellent. Be sure to have a backup of your database first, just in case. An alternative would be to write a plugin that pulls the content from each post, does the filter, then updates the post … Read more
Sorry guys…I actually inherited this install from someone else. The problem was a plugin (BEEP, https://wordpress.org/plugins-wp/brilliant-easy-exclude-posts/ )…It was causing my meta_queries not to work at all. I’m going to file a report with the plugin folks.
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
The after_setup_theme hook is actually an action hook not a filter hook. Nonetheless that should not be needed. Give this a try: if( ! function_exists( ‘get_field’ ) ) { function get_field( $key, $post_id = false, $format_value = true ) { if( false === $post_id ) { global $post; $post_id = $post->ID; } return get_post_meta( $post_id, … Read more
Best way to do it manually. By FTP just download the wp-content/uploads directory. If you want to automate this and the media files zip here is a plugin- downML – Download Media Library But it’s not updated for more than 2 years. So you have to test it before use it on live site. There … Read more
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’ );
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
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