How to load different CSS in different Header?

Enqueue style depending on a template filename: if(‘header.php’ == basename( get_page_template() ) { // check the template file name // enqueue header.php style here } if(‘header-full.php’ == basename( get_page_template() ) { // check the template file name // enqueue header-full.php style here } wp_enqueue_style already registers a style so you don’t need to register a … Read more

How to Handle CSS for Multiple Header header.php Files?

That’s not how you use get_theme_file_uri(); You need to specify the directory RELATIVE to your currently active theme’s directory. So for example, if your currently activated theme is rm-acf1, and all of your custom header CSS files are located in the subfolder hdr-styles. This is your theme directory: ./wp-content/rm-acf1/ This is your header styles directory: … Read more

The best way to add stylesheets to WordPress

To load scrpits only in front-end pages use: add_action( ‘wp_enqueue_scripts’, ‘my_front_end_scripts’ ); function my_front_end_scripts(){ wp_enqueue_script(‘script_handle’); wp_enqueue_style(‘style_handle’); } To load scripts only in login use: add_action( ‘login_enqueue_scripts’, ‘my_login_scripts’); function my_login_scripts(){ wp_enqueue_script(‘script_handle’); wp_enqueue_style(‘style_handle’); } To load scripts only in admin use: add_action(‘admin_enqueue_scripts’,’my_admin_scripts’); function my_admin_scripts(){ wp_enqueue_script(‘script_handle’); wp_enqueue_style(‘style_handle’); }

Have WP Theme update from Git Repository

There’re a couple of libraries out there. One of the more well known is from Joey Kudish and hosted on GitHub itself. Basically it does the following: utilizes the GitHub API Adds a callback to the ‘pre_set_site_transient_update_plugins’ filter Adds another callback to the ‘plugins_api’ filter finally utilizes the WP HTTP API and does a wp_remote_get() … Read more

Customize comment list markup

You should use wp_list_comments(), because this will call a Walker class that can handle comment threads: // from wp_list_comments() if ( empty($walker) ) $walker = new Walker_Comment; $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r); Walker_Comment handles the markup for the comments. You can pass a custom walker to change it. Example: class Simple_Comment_Walker extends Walker_Comment { function … Read more

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