Proper Way to Enqueue CSS for Front Page – template_redirect in functions.php?

Nope. Use the wp_enqueue_scripts hook directly for enqueing all styles and scripts. There’s no need to hook into template_include for that. template_include is specifically for modifying templates. //Adding and Encuing styles for Front Page add_action( ‘wp_enqueue_scripts’, ‘front_page_design’ ); function front_page_design(){ if ( is_front_page() || is_home()) { wp_enqueue_style( ‘home_page_style’, get_stylesheet_directory_uri() . ‘/index-style.css’, array(‘handle_of_main_style’) ); } } … Read more

Include a file before current template file

template_redirect runs before template_include. You can demonstrate that with this: add_filter( ‘template_include’, ‘var_template_include’, 1000 ); function var_template_include( $t ){ echo __FUNCTION__; } // use template redirect to include file add_action(‘template_redirect’, ‘ra_template_block’); function ra_template_block() { echo __FUNCTION__; } Or you could just look at the source: http://core.trac.wordpress.org/browser/tags/3.5.2/wp-includes/template-loader.php Since your code exits in template_redirect the global that … Read more

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