Custom Field help for inserting linked images above posts
-
Hey, everybody, what’s UP!?
Ok, this is my sites posts page: https://www.defossesdesign.com/blog/posts
I found a page in the forums with kinda what I need, but not quite there, and I stink at PHP, so I was hoping someone could do me a quick favor.
OK, so I make a custom field named imgover, and put the image http location (without quotes, cuz they are there already, see code below) in the Value, and it magically appears (see 4th post down).
<?php while (have_posts()) : the_post(); ?>
This next string is what I added. I left in the 2 strings above and below to show you all where it sits in my index.php file.
<img src=”<?php $key=”overimg”; echo get_post_meta($post->ID, $key, true); ?>” />
<div class=”titleAndMeta”>
But it’s not QUITE what I want, because
- I need to be able to make it a link to another site, if I want
- I need to be able to tweek it’s position with CSS
So I’m thinking, maybe surround it with
<div class="overimg">that string</div>
to make it CSS tweakable? Yes?And what about making the whole image a link, if needed?
OK, that’s it, any help would be great, thanks!
- The topic ‘Custom Field help for inserting linked images above posts’ is closed to new replies.