need to apply an if/else statement to Tim Thumb script
Posted on
16th Feb 2014 07:03 pm by
admin
Not sure how to work this. I essentially want to call a variety of image sizes based on which stylesheet a user chooses from the administration backend of a wordpress theme. The sizes of the images would be different depending on which stylesheet is selected. My idea is to write an if/else statement to accomplish this, but don't know how.
The script looks like this:
Code: <?php // This will show the image and link the image to the post. Alter the width and height (in both places) to your needs. ?>
<?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?>
<div class="postthumb">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=180&w=200&zc=1" alt="<?php the_title(); ?>" width="200" height="180" /></a>
</div>
<?php } ?>
If the user selects a layout utilizing a 200px wide image this script would work, but if they choose a layout using a 300px width image the Tim Thumb script would have to be obviously different.
Basically, I would like to offer a different Tim Thumb script based on whatever layout/stylesheet the user selects. And I think the best way is to offer an if/else statement, but I don't know how to do this...
Any help would be greatly appreciated...
Thanks!
No comments posted yet
Your Answer:
Login to answer
150
54
Other forums
date function help
i need help with date function
Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H
SAP Logon Failed
I tried to login to SAP through MMC.
When i click start and give password.
it
How to grab certain words ??
I am working with this API
Returns JSON.
curl http://letsbetrends.com/api/current_trends
Ajax not working on IE 6 for Windows CE
I've created a webpage which uses the classis Ajax in following format:view plaincopy to clipboardpr
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h
Parse multirow HTML table
Hello all,
I have a site I am working on. Its a sports site and I am trying to add stats to a DB
Company Code for Vendors created through Business Partners
Hi, experts!
I'm trying to set up the integration between Business Partner (BP) and Vendo
Not Inserting into DB
I can't get my Add new Division form to submit to the database. Anyone see my issue?
Code: &a
XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h
Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga