Forums

Custom Fields Question (6 posts)

  1. SollyNZ
    Member
    Posted 3 years ago #

    HI there,

    im building a catalog type website and im using Custom Fields to display the products dimensions, info, textures etc

    now this is my code

    <?php
    				$productImageLarge = get_post_meta($post->ID, 'productImageLarge', true);
    				$price = get_post_meta($post->ID, 'price', true);
    				$texture = get_post_meta($post->ID, 'texture', true);
    				$width = get_post_meta($post->ID, 'width', true);
    				$height = get_post_meta($post->ID, 'height', true);
    				$depth = get_post_meta($post->ID, 'depth', true);
    				$strap = get_post_meta($post->ID, 'strap', true);
    				$details = get_post_meta($post->ID, 'details', true);
    				$permalink = get_permalink();
    		?>

    and im using

    <img src="/images/textures/<?php echo $texture; ?>_s.jpg" alt="<?php echo $texture; ?>" class="texture" />

    to display the texture.

    Now what do i need to do if i want to display more than one texture.

    ive tried tried adding two custome fields with the key texture but it only shows the first one.

    any help would be much appreciated :)

    Thanks

  2. SollyNZ
    Member
    Posted 3 years ago #

    Bump,

    anyone got any ideas ?

  3. iridiax
    Member
    Posted 3 years ago #

    I have been unable to figure this out for myself... I think that it would likely involve a loop and iterating through an array.

  4. omgitztrey
    Member
    Posted 3 years ago #

    Why don't you just do a texture2 and etc.?

  5. SollyNZ
    Member
    Posted 3 years ago #

    Sorry should have mentioned,

    I have a list of about 30 textures, and each product has a differnt choice of textures,

  6. SollyNZ
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic