Run shortcode before filters

You can filter the array $no_texturize_shortcodes, which is a collection of shortcodes that are excluded from wptexturize. If you do this, everything within [codigo] shortcode tags will not be texturized: add_filter( ‘no_texturize_shortcodes’, ‘no_texturize_codigo_shortcode’ ); function no_texturize_codigo_shortcode( $excluded_shortcodes ) { $excluded_shortcodes[] = ‘codigo’; return $excluded_shortcodes; }

get_template_directory_uri() and other URL tags not working in theme

What you have: <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/46261/<?php echo get_template_directory_uri(); ?>/css/style.css”> should work fine. I’ve copied and pasted into my header.php and it worked. But this is not how you should be including css or javascript files. The proper way is to use the wp_enqueue_scripts hook. For instance, say you have javascript file you wish to load … Read more

What does “Do not deregister the jquery script in the administration area” mean?

Based on the error… add_action( ‘wp_enqueue_scripts’, function(){ if (is_admin()) return; // don’t dequeue on the backend wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js’, array(), null, false ); wp_enqueue_script( ‘jquery’); }); Honestly, unless you have tremendous traffic over a broad geographic area, I’d say that CDNs are grossly over-rated. I’ve watched the hangup on sites I’ve managed … Read more

Where do I find the functions triggered within a hook?

Looking at the current version of Storefront’s header.php: /** * Functions hooked into storefront_header action * * @hooked storefront_skip_links – 0 * @hooked storefront_social_icons – 10 * @hooked storefront_site_branding – 20 * @hooked storefront_secondary_navigation – 30 * @hooked storefront_product_search – 40 * @hooked storefront_primary_navigation_wrapper – 42 * @hooked storefront_primary_navigation – 50 * @hooked storefront_header_cart – … Read more

How to develop a multilingual theme?

Daniel’s answer was very similar, but applied to plugins rather than themes. For that reason I’ll explain how I specifically did it for themes for anyone else who comes across this problem. Create a folder in the root of your theme called “languages” Go to https://wpcentral.io/internationalization/, search for your language and copy the “WordPress Locale” … Read more

Add a notice to users upon first login to the admin area

something like: add_action(‘admin_notices’, ‘my_notice’); add_action(‘wp_ajax_hide_my_notice’, ‘hide_my_notice’); function hide_my_notice(){ check_ajax_referer(‘hide-my-notice’); $user = wp_get_current_user(); // update status for this user $seen_notice = get_option(‘my_notice’); $seen_notice[$user->ID] = true; update_option(‘my_notice’, $seen_notice); exit; } function my_notice(){ $user = wp_get_current_user(); $seen_notice = get_option(‘my_notice’); // already seen it? if(isset($seen_notice[$user->ID]) && $seen_notice[$user->ID]) return; ?> <div class=”updated fade below-h2″> <p> Hi <?php print esc_attr($user->user_login); ?>! … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)