• I’m not a coder at all, but I can figure out what’s going on for the most part.

    I’m trying to get soem code working that will choose a certain layout for a particular category of posts (my photo blob – category-9).

    I am using the Arras theme, and I think I’ve located the section of code that selects the layouts and stylesheets. I’ve tried to insert code that I found here, on WordPress, that will choose a specific layout for a given category. I’m just not sure of syntax since I am not a coder (keep getting syntax errors in Dreamweaver).

    Here is the code:

    function arras_add_layout_css() {
    	global $arras_registered_alt_layouts;
    
    	if ( count($arras_registered_alt_layouts) > 0 ) {
    
    		if ( defined('ARRAS_FORCE_LAYOUT') ) {
    			$layout = ARRAS_FORCE_LAYOUT;
    		}
    		else
    	    {
    		if ( is_category('9') ) { // Load special CSS for "Photo Blog" category 
    		{
     			?><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/category-9.css" type="text/css" media="screen" />;
    	 		}
                else
            	{
       			<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    			<?php } ?>
    			} else {
    			$layout = arras_get_option('layout');
    		}
    
    		?><link rel="stylesheet" href="<?php bloginfo('template_url') ?>/css/layouts/<?php echo $layout ?>.css" type="text/css" /><?php
    	}
    }

The topic ‘Please help with css selection code1 :D’ is closed to new replies.