Disable front-page.php template

Maybe template_include filter would get the job done for you. Something along these lines, function prefix_another_front_page_template( $template ) { if ( is_front_page() ) { $another_front_page_template=”something.php”; // adjust as needed $new_template = locate_template( array( $another_front_page_template ) ); if ( !empty( $new_template ) ) { return $new_template; } } return $template; } add_filter( ‘template_include’, ‘prefix_another_front_page_template’, 99 );

How to add an HTML tag to the Header?

The hook you’re looking for is wp_head. functions.php add_action( ‘wp_head’, ‘se343581_add_preload_tag’, 5); function se343581_add_preload_tag() { echo ‘<link rel=”preload” href=”‘. plugins_url(‘/gdpr-cookie-compliance/dist/styles/lity.css’) . ‘” as=”style”>’; // // — if added in plugin file — // echo ‘<link rel=”preload” href=”‘ . plugin_dir_url( __FILE__ ) . ‘some_subdir/file_name.css” as=”style”>’; }

creating custom archive template within plugin for custom post type using archive_template filter

I was able to get it working as desired using the condition is_archive() && get_post_type($post) == ‘product’. I also created a custom taxonomy for products as product-category below is the code: function get_custom_post_type_template( $archive_template ) { global $post; $plugin_root_dir = WP_PLUGIN_DIR.’/product-plugin/’; if (is_archive() && get_post_type($post) == ‘product’) { $archive_template = $plugin_root_dir.’/inc/templates/archive-product.php’ } return $archive_template; } … Read more

For custom templates, is it better to use `template_include` or `type_template`?

{type}_template is a filter inside the get_query_template function. That function is called by a series of functions called get_home_template, get_category_template and so on. It allows you to very specifically target templates. You can see it in action in template-loader.php, where the $tag_templates variable is defined, binding conditions like is_home, is_category and so on to the … Read more

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