what theme are you using?
can you post a link to your site?
Thread Starter
KEJNAV
(@kejnav)
It’s custom built theme.
Site http://skyinx.com/blog
your theme info says it is based on Twenty Ten;
possibly look for loop.php of your theme;
look for a line with <div class="post… and some more code;
edit this accordingly.
or possibly paste the full code of loop.php into a http://pastebin.com/ and post the link to it here.
someone might have look at it and might be able to make some useful suggestions.
and also try to contact who ever build that theme for you – this might be easier and faster.
Thread Starter
KEJNAV
(@kejnav)
close to the beginning of the code, see these lines:
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
define what you would like instead, and edit the code.
edit:
the style.css does not seem to have any styles for .post-cat-three – therefore you could simplyfy the above code:
<div class="post">
Thread Starter
KEJNAV
(@kejnav)
in_category('3')
Hmm when I delete this number , then all works fine with .post class.
But I want to know what this number “in my case 3” do?
Is it the number of category? If it is how to know number of category?
yes – 3 is the category ID of your category ‘inspiration’ or so.
to find the category IDs of your categories, goto
dashboard – posts – categories; and hover over the category names in the list, then look at the address bar at the bottom of the browser:
it will show ........&tag_ID=3&..... where 3 is the category ID of the category where the mouse pointer hovers over.
http://codex.wordpress.org/Function_Reference/in_category
Thread Starter
KEJNAV
(@kejnav)
Ok Thank You.
I think this will be last question 😀
How to add more of categories.
I tried:
<?php if ( in_category(‘3’) ) { ?>
<div class=”post-cat-three”>
<?php if ( in_category(‘4’) ) { ?>
<div class=”post-cat-four”>
<?php } else { ?>
<div class=”post”>
<?php } ?>
then I tried:
<?php if ( in_category(‘3’) ) { ?>
<div class=”post-cat-three”>
<?php else ( in_category(‘4’) ) { ?>
<div class=”post-cat-four”>
<?php } else { ?>
<div class=”post”>
<?php } ?>
It doesn’t work…
How to add more categories with different class?
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } elseif ( in_category('4') ) { ?>
<div class="post-cat-four">
<?php } else { ?>
<div class="post">
<?php } ?>
structure:
if
elseif
elseif /*repeated as often as needed*/
else
http://php.net/manual/en/control-structures.elseif.php
Thread Starter
KEJNAV
(@kejnav)