Conditional code to relative position attached images only
-
Hey everybody,
So I got the idea to write a grid-style theme with a clickable thumbnail above each post.
My one question so far is how to make it so that the default thumbnail (for posts with no image) stays right where it is, but when an attached image is displayed as the thumbnail, it is moved relatively upward.
I have tried adding
<?php ( if is_attachment()) { echo 'class=""' }; ?>
to my existing code like this:<img <?php ( if is_attachment()) { echo 'class=""' }; ?> border="0" width="200" src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>">
to see if I could assign a class only to attached images, but I get this error:
Parse error: syntax error, unexpected T_IF in /blah/blah/blah/wp-content/themes/WFHS/index.php on line 16
I’m sure this must be simple. I just want to assign a class only to attached images so that the default image can stay in place and attached images can be positioned relatively upward (like
position: relative; top: -15px;
or something).If you want to see the page it’s here. I’m using my old high school as a guinea pig for the theme. The content is all from feeds (just for the example).
You can see that by displaying the very top of each thumbnail you often end up with something that only shows the top of somebody’s hair or something.
I also want to add a featured post slider above the post excerpts, but one thing at a time…
Thanks
- The topic ‘Conditional code to relative position attached images only’ is closed to new replies.