NameSilo

PHP Genius Please

SpaceshipSpaceship
NamecheapNamecheap
Namecheap AuctionsNamecheap Auctions
Watch

jamesau

Top Member
Impact
1,054
I'm trying to custom style a particular category of post on my Wordpress blog. I'm not familiar with PHP so i'm not sure what I need to add to make this section of code work:

Code:
<?php 
			if ( in_category( 'mini-ideas' )) {
			
				<div>
				        Custom Style Information Here
				</div>
				
			} else {

				<div>
				        Normal Style Information Here
				</div>				
				
			}
?>

Any help would be most appreciated.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
You need to close the PHP tags

PHP:
<?php 
			if ( in_category( 'mini-ideas' )) {
?>
			
				<div>
				        Custom Style Information Here
				</div>
<?php 				
			} else {
?>
				<div>
				        Normal Style Information Here
				</div>				
<?php 
			}
?>

or

PHP:
<?php 
if ( in_category( 'mini-ideas' )) {
echo '<div>Custom Style Information Here</div>';
} else {
echo '<div>Normal Style Information Here</div>';
}
?>
 
0
Close
Awesome thanks sdsinc. Got it set up at Cogroll now.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back