One page, every post has it's own div & CSS, how?
-
Hi. Right now I have my unfinished portfolio:
https://www.mirelmasic.nl
. The white squares with text are separate posts, and not all of them are of the same category. I want to make the website in a ‘city skyline’, each white square is a building. For example (for this topic’s sake, I’ll keep it simple), I want post X to feature a triangle on top of it, and post Y an antenna. So Post X uses div X, and Post Y uses div YHow do I exactly do this? this is the entirety of my content within <body>:
<div class="container"> <?php if(have_posts()) : ?><?php while (have_posts()) : the_post(); ?> <div class="post"> <center><h1><?php the_title(); ?></h1></center> <?php the_content(); ?> </div> <?php endwhile; ?> <?php endif; ?> </div>
Can I make a if statement outside the container div? If category X, then show div X (triangle), elseif category Y, then show div Y (antenna), and so on with other types of buildings.
Is there a certain plugin which can help me achieve this, without the use of if statements? If someone knows something, I’d greatly appreciate it, I never got around to thinking this one out. Thanks ??
If anyone’s interested, here’s the css: https://www.mirelmasic.nl/wp-content/themes/mireltheme/style.css
- The topic ‘One page, every post has it's own div & CSS, how?’ is closed to new replies.