WordPress.org

Ready to get started?Download WordPress

Forums

Custom Fields Troubleshooting (3 posts)

  1. vacom
    Member
    Posted 5 years ago #

    I have using the WordPress Theme: Magasin Dos form <a http://www.paddsolutions.com, in custom fields I don’t want use my image form wp content because it’s make my blog loading are slow but i want use image from flickr.com or photobucket.com.

    I'm trying send email to author at http://www.paddsolutions.com but it's no respon.

    this code at gallery.php:

    <?php while (have_posts()) : the_post(); ?>
    	<?php
    		$customfields = get_post_custom();
    		$scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-dos/functions/timthumb.php?';
    		if (empty($customfields['paddimage'][0])) {
    			$imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . '/wp-content/themes/magasin-dos/images/thumbnail.png' . '&amp;w=68&amp;h=68&amp;zc=1';
    		} else {
    			$imgpath = $scrp . 'src=' . get_bloginfo('wpurl') .  $customfields['paddimage'][0] . '&amp;w=390&amp;h=250&amp;zc=1';
    		}
    	?>

    Any somebody help me?

  2. Ben Sutcliffe
    Member
    Posted 5 years ago #

    <?php while (have_posts()) : the_post(); ?>
    	<?php
    		$customfields = get_post_custom();
    		$scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-dos/functions/timthumb.php?';
    		if (empty($customfields['paddimage'][0])) {
    			$imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . '/wp-content/themes/magasin-dos/images/thumbnail.png' . '&amp;w=68&amp;h=68&amp;zc=1';
    		} else {
    			$imgpath =  $customfields['paddimage'][0];
    		}
    	?>

    That would take the image from whichever URL you have as your custom field - so enter http://flickr.com/myuserid/picturereference for that picture.

    Only problem is that you will need to render the size yourself. So wherever the image actually gets printed, probably something like

    <img src="<?php echo $imgpath; ?>" alt="Something">

    you'll need to add the max width you want (or the max height):

    <img src="<?php echo $imgpath; ?>" alt="Something" width="68">

  3. vacom
    Member
    Posted 5 years ago #

    How to edit this code so that I get put image form flickr.com or photobucket.com?

    $scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-dos/functions/timthumb.php?';

Topic Closed

This topic has been closed to new replies.

About this Topic