php - How do I create per page and per category stylesheets in Wordpress? -


i'm trying create many different skins apply depending on page , category of wordpress site. not sure of 2 things:

  1. how use or statement in php call on skin1.css stylesheet if is_page('x') or if is_category('1'). (on note, how specify multiple pages and/or categories in same line?
  2. why following code displaying text in header of web site?
  3. there must better way write these if else statements. tips?

i know mess. bare me , in advance. i'm learning php go , once project complete, i'll sit down , digest language , practices.

    < ?php if (is_page( 'health' ) ) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/health-skin.css" />     < ?php } elseif (is_page( 'beauty' ) ) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/beauty-skin.css" />     < ?php } elseif (is_page( 'home' ) ) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/home-skin.css" />     < ?php } elseif (is_page( 'food' ) ) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/food-skin.css" />     < ?php } elseif (is_page( 'travel' ) ) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/travel-skin.css" />     < ?php } else { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/skins/default-skin.css" />     < ?php } ?> 

&&  //=and ||  //=or !== //=not same !   //=not 

http://www.w3schools.com/php/php_operators.asp


Comments

  1. This is a amazing post. This article is good . For more detail in briefly click here

    HOW TO USE OPERATOR IN PHP

    ReplyDelete

Post a Comment

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -