Theme Check gives: Required: This theme doesn’t seem to display tags?

You need to be using one of these functions to display a list of tags associated with the post: the_tags() get_the_tag_list() get_the_term_list() Otherwise the check will fail. If you’re building this theme for use with a project that doesn’t need tags, don’t bother adding support. If you’re intending on uploading it to WordPress.org for review, … Read more

Custom attribute for the title tag with wp_title()

Since all _wp_render_title_tag does is check for title-tag theme support and wrap in <title> tags, there is really no reason why your existing implementation “shall not pass”, since the proper implementation is already identical via: <title itemprop=”name”><?php echo wp_get_document_title(); ?></title> when _wp_render_title_tag does: echo ‘<title>’ . wp_get_document_title() . ‘</title>’ . “\n”; (since Theme Check is … Read more

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

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

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