Hi all,
How do i tell wordpress to format a page differently if i am using a certain category..
eg: if cat15 use category-images.php
Thank you!
Jim C.
Hi all,
How do i tell wordpress to format a page differently if i am using a certain category..
eg: if cat15 use category-images.php
Thank you!
Jim C.
Either via category templates:
See: http://codex.wordpress.org/Category_Templates
Or you could also use the body_class function:
thats great thank you madjax..
Madjax,
Do you know how I would tell wordpress the following:
Display normal category layout, unless on certain category, eg: video, then deliver a different layout, eg: thumbnails only..
This will be contained in the category loop, any examples would be great. I am not an expert php coder.
Thank you!
J
Use conditions like
if (in_category('video')) :
//put the code here for video according your design.
else
//put the code here according your design.
endif;
Many thanks Chinmoy!
I'm not sure my code is correct - coul you just check my code, in particular the PHP syntax:
// The Category Loop
function thematic_category_loop() {
while (have_posts()) : the_post(); ?>
<?php if(in_category('17') ) : ?>
<!-- layout #1 -->
<?php if( in_category( array( 19,20 ) ) : ?>
<!-- layout #2 -->
<?php else : ?>
<!-- default layout -->
<?php endif; ?>
Many thanks,
Jim C
// The Category Loop
function thematic_category_loop() {
while (have_posts()) : the_post(); ?>
<?php if(in_category('17') ) : ?>
<!-- layout #1 -->
<?php elseif( in_category( array( 19,20 ) ) : ?>
<!-- layout #2 -->
<?php else : ?>
<!-- default layout -->
<?php endif; ?>
}?>This topic has been closed to new replies.