Unique design inside a specific category’s url

There is a filter called theme_page_templates which you can use to force the use of a certain template under certain circumstances. Like this: add_filter (‘theme_page_templates’, ‘wpse263827_filter_theme_page_templates’, 20, 3 ); wpse263827_filter_theme_page_templates ($page_templates, $this, $post) { if (condition based on $post) $page_templates=”path-to-template.php”; return $page_templates; } So, you can place the template file wherever you want and assign … Read more

How can I use default CPT templates from sub-folder?

I think you should use single_template filter hook to load your template from a subdirectory. The full code will be like below- function the_dramatist_get_custom_post_type_template($single_template) { global $post; if ($post->post_type == ‘your_post_type’) { // Your post type directory with the post type template file name $single_template = dirname( __FILE__ ) . ‘/post-type-template.php’; } return $single_template; } … Read more

Pass variable from action back to template

The difference between add_action() and add_filter() is semantic not technical, except that a filter expects a returned value and an action does/will not. The question is whether contact_form_send_email() needs to be called-at /hooked-to init. If not, you can define your filter in the template with apply_filters(), and then hook to it to run your function … Read more

Trying to create a template without navigation and footer

If you take a look into the codex page for get_header() function, you will notice that WordPress automatically adds a header- prefix to your call. For example, using this: get_header(‘sample’); Will search for the header-sample.php file. So, in your case, you should name your header file header-headerremoved.php and then call it the following way: get_header(‘headerremoved’);

get_header(), get_footer() from plugin template

Old question, but maybe my answer will help someone. Short answer is: use load_template() function with full file server path as first argument passed to it. Long answer: get_header() using the function locate_template() which uses the function load_template() which uses the function require_once(). Thus, to load the header layout from a plugin or any other … Read more

How to use index.php as a template for archives?

I haven’t tested this but in your archive.php file in the child theme use the following command to output the index.php file contents. <?php get_template_part( ‘index’ ); ?> This way you can have all the code in your index.php file but use it elsewhere preventing the duplication. If you don’t want to create an archive.php … Read more

I have problems with loading javascripts

You seem to be loading both file/folder names into the queue. get_template_directory_uri() . ‘http://fitclaw.com/wp-content/themes/Coming%20Soon/js/jquery.js should only be: get_template_directory_uri() . ‘/js/jquery.js’ And so-on and so-forth. because get_template_directory_uri returns, or should be returning this string for you: ‘http://fitclaw.com/wp-content/themes/Coming%20Soon/’ And you should always try to use those relative paths versus hard-coding them.