Forums

Custom Fields to set background imgs (3 posts)

  1. 1721media
    Member
    Posted 2 years ago #

    I'd like to have the three horizontal sections on the first page each show a unique image.

    It has to be a background image. Is this possible?

  2. richarduk
    Member
    Posted 2 years ago #

    HTML
    <div class="box" id="whatever">
    
    blah
    
    </div>
    
    CSS
    #whatever{background:transparent url(images/prettypicture.jpg) top left no-repeat;}

    Not sure why you need custom fields

  3. 1721media
    Member
    Posted 2 years ago #

    Each of the 3 divs there brings in content from a different category.

    Here it is:

    <div class="box<?php echo $end; ?>">
    
    		<?php
    		query_posts('cat=' . $val);
    		if (have_posts()) : $first = true;
    		while (have_posts()) : the_post();
    		if ($first) : $first = false;
    		?>
    		<p><?php ob_start(); the_excerpt(); echo dp_clean(ob_get_clean(), 140); ?></p>
    		<a href="<?php the_permalink(); ?>" class="readmore">
    
                    </a>
    		<ul>
    		<?php else: ?>
    		<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    		<?php endif; endwhile; ?>
    		</ul>
    		<?php endif; ?>
    		</div>

    Is this overkill?

Topic Closed

This topic has been closed to new replies.

About this Topic