Jump to content
Sign in to follow this  
rsutton1223

Featured Images and Custom Fields

Recommended Posts

rsutton1223

My previous theme used the "image" custom field to show images on the homepage and single.php. PageLines uses the featured image Wordpress function. Is there a way to merge the two so my previous images show up?

Share this post


Link to post
Share on other sites
Andrew

Probably would have to patch the code; but we'll look into this for you.. Mission critical right now?

Share this post


Link to post
Share on other sites
rsutton1223

It is critical to the redesign process. At least in the next couple of days. The other option would be to replace your thumbnail code with a timthumb code that pulls from that custom field.

Share this post


Link to post
Share on other sites
rsutton1223

Or a conditional if statement that says if no featured image use "image" custom field...

Share this post


Link to post
Share on other sites
cmunns

what is the name of your custom field? and is that data still present.

Share this post


Link to post
Share on other sites
rsutton1223

Data is still present and the custom field is named "image"

Share this post


Link to post
Share on other sites
Andrew

You could change this code in template.postloop.php: ` <?php if(pagelines_show_thumb( get_the_ID() )): // Thumbnails ?>

<?php the_post_thumbnail('thumbnail');?>
<?php elseif(get_post_meta($post->ID, 'image', true): ?> <?php echo get_post_meta($post->ID, 'ima <?php endif; ?> ` Did not test this...

Share this post


Link to post
Share on other sites
rsutton1223

That one breaks it. Is there a space or character in the elseif statement that is out of place somewhere?

Share this post


Link to post
Share on other sites
cmunns

Yes, he missed the closing parenthesis on this line `<?php echo get_post_meta($post->ID, 'ima`

Share this post


Link to post
Share on other sites
Andrew

Well can you play with it? What error?

Share this post


Link to post
Share on other sites
cmunns

Robb, can you show me the code you have? I want to check your code directly for missing markup, not Andrew's version.

Share this post


Link to post
Share on other sites
rsutton1223

I took it out because I had to go live with the site and I couldn't keep it from breaking the loop. I used Andrew's with the added in ) to close that action.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×