• The Goal:
    I would like there to be a bg image (of a steel grate) that repeats the length of my entire page. Then the actual content has a 75% opacity black background, to break it off from the bg image with white type.

    The Code
    PhP Code-

    <!-- News Feed -->
    	<div id="contentbg"></div>
        <div id="content" class="narrowcolumn" role="main">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    
    	</div>

    Css Code-

    #contentbg {
    	font-size: 1.2em;
    	z-index:2;
    	width: 600px;
    	height:1500px;
    	background-repeat:repeat;
    	background-image:url(images/ContentBG.jpg);
    	background-color:#333;
    	position:absolute;
    	margin-left:250px;
    
    	}
    
    /*Page Styles */
    #content{
    	z-index:15;
    	width:650px;
    	height:inherit;
    	position:absolute;
    	background-repeat:repeat;
    	margin-top:150px;
    	background-image:url(images/contentbg.png );
    	margin-left:250px;
    
    }

    The Problem:
    Currently I can only get the grate bg image to repeat on the y axis if I use a pixel count (current 1500px). I’m guessing because I have not nested the actual loop inside the <div id=”contentbg”> so the computer see’s no length for this div. I tried nesting the entire <div id=”content” class=”narrowcolumn” role=”main”> inside the <div id=”contentbg”> but this messes with the zindexs I’m using.

    My Question:
    I am still new to Php, I feel like I have a decent grasp on it’s basics but I have never wrote and if then statement. Would it be possible to create a statement that simply matches the height of <div id=”contentbg”> to the height of <div id =”content”>?

    OR

    is there a way where I can set a max page size with pixels, and tell my wordpress content to cut off a post and start a new page, if it’s content exceeds the max page size.

    again this is the first time I’ve made a theme from scratch (well ok I started with the default theme), so I’m probably made a few errors, and I’m hoping this is a quick fix. Thanks in advance for any help.
    -Snoddie

  • The topic ‘Setting Page Length’ is closed to new replies.