Is there a way to set the order of wp_footer hooked functions?

The recommended way is to call your function inside the .js file you are enqueuing. Is there any reason you can’t do that? If you need access to dynamic data like WP options from within your script, use wp_localize_script to initialize a javascript object with the data you need: $data = array(‘some_option’ => get_option(‘an_option_from_my_theme’)); wp_enqueue_script(‘your_script_handle’, … Read more

How wp_cache is supposed to work, and does it help with performance?

In WordPress v2.5+ the object cache is not persistent. It will save things in memory, but for persistent caching across page loads you will need a plugin see here: http://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Caching Alternatively, use transients, which are persistent. The identifier must be 45 or less characters long, but the data attached to that identifier can be longer. … Read more

function_exists call in function.php

That twentyeleven_setup function, and others like it, are pluggable – meaning that they can be overridden by a child theme. The child theme’s version of a function with that same name will be parsed first, so the parent theme’s version will not be run at all. In TwentyTwelve some functions are not pluggable, but instead … Read more

How to add multiple images to a custom post type single post?

Thanks for the suggestions, guys. I did some more research, and found this – https://wordpress.org/plugins/attachments/ It’s a great plugin that lets you attach images to the post without inserting them in the post and the images can be easily sorted with ajax, it’s also quite modifiable and just what I needed, and works on custom … Read more

Adding items to page template dropdown on Page Edit Screen

I thought I would provide you with another approach. It is also a bit hackish, but it is general purpose and allows you to simply register the filename and label that you want to use, like so: if ( class_exists( ‘WPSE_196995_Page_Templates’ ) ) { WPSE_196995_Page_Templates::register_page_template( ‘My Page Template’, ‘my-page-template.php’ ); } You could add the … Read more