Viewing 6 replies - 1 through 6 (of 6 total)
  • when i want use an external url, it won’t work

    Where are these images located? Are they your images?

    Thread Starter imeancomeonjoe

    (@imeancomeonjoe)

    no they’re not my images, they’d be from other websites to ie promote their site or product or image.

    It may seem rather obvious but can you upload these images to your site? Only the code snippet you gave above doesn’t lend itself to dealing with external image urls. My guess is that when you try to use an external url, you’re getting a blank space, yes?

    Thread Starter imeancomeonjoe

    (@imeancomeonjoe)

    yes exactly i am getting a blank scree. I know i can upload these images to my wp folder but I’m working with someone who is used to the simplicity of twitter and just copying and pasting the links they see. any ideas how to work around it?

    thanks

    How about, when adding an external image, writing in “external” for name and the url for value?

    <?php
    $thumb = get_post_meta($post->ID, 'thumb', true);
    $external = get_post_meta($post->ID, 'external', true);
    
    if( $thumb !== '' ) :?>
    "><img src="<?php bloginfo('template_directory'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=270&w=430&zc=1" alt="<?php the_title(); ?>" width="430" height="270" />
    
    <?php elseif( $external != '' ) : ?>
    "><img src="<?php echo get_post_meta($post->ID, 'external', $single = true); ?>" alt="<?php the_title(); ?>" width="430" height="270" />
    
    <?php else : ?>
    "><img src="<?php bloginfo('template_directory'); ?>/images/bigthumb.png" alt="<?php the_title(); ?>" width="430" height="270" />
    
    <?php endif; ?>

    Bear in mind that this is off the top of my head and hasn’t been tested for syntax errors etc.

    Thread Starter imeancomeonjoe

    (@imeancomeonjoe)

    It didn’t work esmi.. but thank you! We’re going to just download the pics and use it as it was set up.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Inserting external url won’t work on theme’ is closed to new replies.