WordPress.org

Ready to get started?Download WordPress

Forums

Can I hack this code to do the following? (1 post)

  1. accesstjr
    Member
    Posted 4 years ago #

    Hi,

    The following template calls in child pages of the services section and displayes them as a list with the first few lines of text and a thumbnail. I want to know if there is there a way to hack it to ALSO call in child pages from another section so I can essentially split the page.

    Many thanks!

    <?php get_header();?>
      <div id="main">
    		<div id="maintext">
          <h2><?php the_title();?></h2><!-- Page Title Here -->
    		  <?php
    		  global $post;
          $substitle = get_post_meta($post->ID,"subtitle",true);
          if ($substitle) echo "<h1>$substitle</h1>";
          ?>	
    
       <?php
            $services_pid = get_option('CT_services_pid');
            query_posts('post_type=page&post_parent='.$services_pid);
    
            if ( have_posts() ) :
            while ( have_posts() ) : the_post();
        	?>
            <div class="blog-post">                                    
    
              <?php if (get_post_meta($post->ID,"thumbnail",true)) { ?>
    
                <img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php echo get_post_meta($post->ID,"thumbnail",true);?>&h=110&w=150&zc=1" alt="<?php the_title(); ?>" class="imgleft" />
                <h4 class=services><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
                <?php } else { ?>
                <img src="<?php bloginfo('template_directory');?>/timthumb.php?src=<?php bloginfo('template_directory');?>/images/nothumbnail_small.jpg&h=110&w=150&zc=1" alt="<?php the_title(); ?>" class="imgleft"/>
                <?php }?>
                <?php excerpt(50);?>
              	<span class="read-more"><a href="<?php the_permalink();?>">Read more</a></span>
                <div class="clear"></div>
            </div><!-- end of post -->
            <?php endwhile;?>
            <?php endif;?>
          </div><!-- end of maintext -->
    		</div><!-- end of main -->
    		<?php wp_reset_query(); ?>
    		<?php get_sidebar();?>
    		<?php get_footer();?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.