• Hi

    I’m trying to include the contents of a specific page (about us) within a section on the homepage. How do I edit the code below so that the about us page is included and not the most recent article post? Thanks in advance!

    <div class="homepagemid">
    <h3><?php echo cat_id_to_name(st_option('hp_mid_cat')); ?></h3>
    <?php $recent = new WP_Query("cat=" .st_option('hp_mid_cat'). "&showposts=" .st_option('hp_mid_num') ); while($recent->have_posts()) : $recent->the_post();?>
    <div class="homepagethumb">
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
    <?php else: ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_directory'); ?>/images/default_thumbnail.jpg" alt="<?php the_title(); ?>" /></a>
    <?php endif; ?>
    </div>
    <div class="homepagecontent">
    <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>
    <?php the_content_limit(480, ""); ?>
    </div>
    <?php endwhile; ?>
    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Stefan

    (@stefan83)

    Can anyone help with this? Thanks!

    Thread Starter Stefan

    (@stefan83)

    Ok, I’ve found a solution:

    <?php
    $page_id = 2;
    $page_data = get_page( $page_id );
    $content = $page_data->post_content; // Get Content
    echo $content;
    ?>

    Can anyone now help me to limit the content to a number of characters and add a link to the full article? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display a specific page’ is closed to new replies.