Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

PHP Genius Please

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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
•••
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
•••
Awesome thanks sdsinc. Got it set up at Cogroll now.
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back