wp_enqueue_script fails to include in footer

Use the approach below to enqueue your scripts using a single action hook: /** * Proper way to enqueue scripts. * The same approach can be used to enqueue styles. */ function my_interface_enqueues() { wp_enqueue_script( ‘require-js’, plugin_dir_url( __FILE__ ) . ‘js/libs/requirejs/require.js’, array(), ‘1.0.0’, true ); wp_enqueue_script( ‘main-js’, plugin_dir_url( __FILE__ ) . ‘js/main.js’, array(), ‘1.0.0’, true … Read more

How WordPress knows where to find locale files?

Plugins and themes pull the translation files manually from (mostly) their directory. There are 2 different functions which handle this: For plugins : load_plugin_textdomain() For themes: load_theme_textdomain() The syntax would be something like this, mostly hooked into init or plugins_loaded action hook: load_plugin_textdomain( ‘text-domain’, get_template_directory() . ‘/some-directory’ ); OR: load_plugin_textdomain( ‘text-domain’, false, basename(dirname(__FILE__)).’/some-directory’); Look for … Read more

What’s the _wp_desired_post_slug value for?

See this line in WordPress core. Explanation: When you move a post to the trash, _wp_desired_post_slug holds the slug that was desired for that post (now in the trash); i.e., when you move a post to the trash, WordPress suffixes the old slug so that it becomes available again, but it remembers the slug that … Read more

How to change Thumbnail size of next Gen Gallery plugin?

For the specific display you will need to re-open the IGW by clicking on the preview image in the post/page then under the customizations tab change the override thumbnail size option to yes and set the dimensions as needed. You may need to clear your image cache under Gallery > Other Options > Miscellaneous to … Read more