Should `get_template_directory_uri()` be escaped?

In that function we find a hook: return apply_filters( ‘template_directory_uri’, $template_dir_uri, $template, $theme_root_uri ); So, yes, the URI can be changed by plugins, and you should escape its returned value. The same principle applies to all WordPress URI functions, like get_home_url(), get_site_url() and so on. Keep in mind that there are not only good plugin … Read more

Form to Add Posts to Custom Post Type

posting from the front-end is a matter of displaying a form and processing it: form: <!– New Post Form –> <div id=”postbox”> <form id=”new_post” name=”new_post” method=”post” action=””> <!– post name –> <p><label for=”title”>Title</label><br /> <input type=”text” id=”title” value=”” tabindex=”1″ size=”20″ name=”title” /> </p> <!– post Category –> <p><label for=”Category”>Category:</label><br /> <p><?php wp_dropdown_categories( ‘show_option_none=Category&tab_index=4&taxonomy=category’ ); ?></p> … Read more

With WordPress themes, where do I store the images and files relatively?

Let me answer your question with a question: Are these images part of your template or for general purpose? The WordPress theme “Responsive” has images files all over its theme folder. The theme should be at yoursite.com/wp-content/themes/responsive. In that theme folder there are a few folders with images: The obvious “images”, also “icons” and “includes/images”. … Read more

Bestway To Define Theme and Plugin path and url

Do not use constants for that. Do not use global constants at all. There are two types of constants: class/interface constants and global constants. Constants in classes or interfaces are fine and sometimes useful. An overly simplistic example: interface Requirements { const MIN_PHP_VERSION = 5.4; public function php_is_good(); } class Theme_Requirements implements Requirements { public … Read more

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