• OKay, this code worked for me before:

    <?php $Image = get_post_meta($post->ID, 'bg_image', true); ?>
    <img src="<?php echo $Image; ?>" name="MainImage" alt="" border="0" />

    I have it in my header, and it’s not doing anything…

Viewing 11 replies - 1 through 11 (of 11 total)
  • I think that code needs to be used within the Loop.

    Thread Starter menesrk

    (@menesrk)

    the thing is I’m using multiple loops

    <?php rewind_posts(); ?>
    
      <?php while (have_posts()) : the_post(); ?>
    
    <div id="myBG" style="height:100%;width:100%;z-index:10;visibility:show;position:absolute;overflow:auto;left:0px;bottom:0px;background-image:url(<?php $mykey3='mykey3'; echo get_post_meta($post->ID, bg_tile, true); ?>);">
    <table height="96%" width="100%" cellpadding="0" border="0" cellspacing="0" style="background-image:url(<?php $key200='mykey3'; echo get_post_meta($post->ID, bg_tile, true); ?>);background-attachment:scroll;"><tr valign="bottom"><td>
    
    <?php $Image = get_post_meta($post->ID, 'bg_image', true); ?>
    <?php echo $Image; ?>
    <img src="<?php echo $Image; ?>" name="MainImage" alt="" border="0" />
    
    </td></tr></table>
    </div>
    <?php endwhile; ?>
    Thread Starter menesrk

    (@menesrk)

    that was my attempt to put it inside it’s own loop. still didn’t work.

    Have you reviewed Multiple Loops?

    Thread Starter menesrk

    (@menesrk)

    yes that’s where i took that code from.. – when i view source none of the custom fields are showing up..

    So you want to display all posts twice?

    Thread Starter menesrk

    (@menesrk)

    no, https://konphlux.net

    I just wanted a horizontal theme so I used multiple loops to split the content [which isn’t working too well with ‘view next post’]…

    now I’m making a custom field so I can display a diff background image on each post/page so apparently i need to put it inside it’s own loop but it’s just going blank.

    Did you add the_meta()

    I just wanted a horizontal theme so I used multiple loops to split the content [which isn’t working too well with ‘view next post’]…

    That might be handled better (and easier) by using a single query and then floating the posts left using CSS.

    now I’m making a custom field so I can display a diff background image on each post/page

    Are you using the post_class() on your post blocks? Again, with that template tag in place, there’s a lot you can achieve using pure CSS.

    Thread Starter menesrk

    (@menesrk)

    where do i need to add that? the_meta() ?

    Thread Starter menesrk

    (@menesrk)

    ok. thanks yall..

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom Fields Not Working’ is closed to new replies.