NameSilo

PHP Genius Please

SpaceshipSpaceship
Watch

jamesau

Top Member
Impact
1,053
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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
•••
Awesome thanks sdsinc. Got it set up at Cogroll now.
 
0
•••
Appraise.net

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back