Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter shaun1981

    (@shaun1981)

    Thanks

    Thread Starter shaun1981

    (@shaun1981)

    Excellent thanks. It was the end of the first line I was getting wrong.

    Thread Starter shaun1981

    (@shaun1981)

    Thanks

    Thread Starter shaun1981

    (@shaun1981)

    Ok think i’ll forget the text boxes thing and just put together a little PDF file for them.

    Thank you for pointing that out for me, i’ll take a look at the contributor level.

    Thread Starter shaun1981

    (@shaun1981)

    Also my wordpress site is on a subdomain if this has any bearing on things?

    Thread Starter shaun1981

    (@shaun1981)

    Ok i think i have resolved this using query_posts. Here’s the code for anyone interested

    <?php
    /*
    Template Name: Homepage
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php $temp_query = $wp_query; ?> 
    
    <div id="news">
    <div id="featured">
    <h1>Latest News</h1>
    <?php query_posts('showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>
    </div>
    <div id="headlines">
    <h2>News Headlines</h2>
    <?php query_posts('showposts=3&offset=1'); ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>
    </div>
    <p class="clear"></p>
    </div>
    
    <div id="content">
    
     <?php
    
    query_posts('page_id=5');
    
    global $more;
    $more = 0; 
    
    while (have_posts()) : the_post();
      the_content('Read the full post »');
    endwhile;
    ?>
    
    </div>
    
    <?php get_footer(); ?>
    Thread Starter shaun1981

    (@shaun1981)

    Thanks. I have managed to get the dynamic content and static content displaying on the page now with just one problem. I want the dynamic “news” section at the top of the page above the static content but can’t get that to work.

    Here’s my code now:

    <?php
    /*
    Template Name: Homepage
    */
    ?>
    
    <?php get_header(); ?>
    
    	<div id="content">
    
        <?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"><strong>Read the rest of this page &raquo;</strong></p>'); ?>
    
    				<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    
    			</div>
    		</div>
    	  <?php endwhile; endif; ?>
    
    </div>
    
    <?php $temp_query = $wp_query; ?> 
    
    <div id="news">
    <div id="featured">
    <h1>Latest News</h1>
    <?php query_posts('showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>
    </div>
    <div id="headlines">
    <h2>News Headlines</h2>
    <?php query_posts('showposts=3&offset=1'); ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>
    </div>
    <p class="clear"></p>
    </div>
    
    <?php get_footer(); ?>

    I tried re-arranging the code so that the news section was above but when i do that it loses the static content and just displays the full posts. Any ideas?

    Thread Starter shaun1981

    (@shaun1981)

    I appear to have got it working by adding the following

    <?php
    if( is_page(116) ) {
    	$img = 'image1.gif';
    	$alt = 'image 1';
             $link = 'link.html';
    } else {
    	$img = 'image2.gif';
    	$alt = 'image 2';
             $link = 'link2.html';
    }
    ?>
    <a href="<?php echo $link; ?>"><img src="<?php echo $img; ?>" alt="<?php echo $alt; ?>" /></a>
Viewing 8 replies - 1 through 8 (of 8 total)