• Resolved yudiqing

    (@yudiqing)


    Hi, the problem is like this.
    I will include some codes to check whether a page is using a certain template, and if so, i will call a css file to be used for such page.

    If I add this code in the Code Snippets plugin, where do I put the css files and how to write the file address of the css files in the code?

    Many thanks in advance.

    https://www.ads-software.com/plugins/code-snippets/

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    You can write a snippet like this:

    add_action( 'wp_head', function () {
    	if ( is_archive() || is_search() ) {
    		?>
    		<style>
    
    		/* css code goes here */
    
    		</style>
    		<?php
    	}
    });
Viewing 1 replies (of 1 total)
  • The topic ‘How to include a stylesheet in the code snippets plugin’ is closed to new replies.