Support » Themes and Templates » [Help] TwnetyTen Church Theme hack – How to add posts under static page

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

    You probably need to add a custom query to your theme’s front page template file (either index.php or front-page.php).

    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Function_Reference/WP_Query

    Anuradha Edirisuriya

    (@anuradhaedirisuriya)

    Thank you for the reply. I’m a newbie in php functions. 🙁
    Can you help me to find the exact code that would do the job?

    Below is an example of what exactly I want. It is edited with photoshop.

    View post on imgur.com

    Regards,
    Anuradha.

    Anuradha Edirisuriya

    (@anuradhaedirisuriya)

    I was able to do it successfully with

    <div id="content">
    <div class="post">
    
    <h3>Recent Articles</h3>
    
    <?php $posts = get_posts( "category=X&numberposts=5" ); ?>
    <?php if( $posts ) : ?>
    <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
    <div class="post">
    <h2><a href="<?php echo get_permalink($post->ID); ?>" ><?php echo $post->post_title; ?></a></h2>
    <?php the_excerpt(); ?>
    
    </div>
    <?php endforeach; ?>
    <?php endif; ?>
    
    </div>

    this code. But whenever I go to another page, the recent news appear on other pages too. The function, is_home() is also not working. Please help me to solve the issue.

    Sorry, I couldn’t mention my website earlier.
    http://prefects.bandaranayakecollege.org

    Thank you.
    Anuradha.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Help] TwnetyTen Church Theme hack – How to add posts under static page’ is closed to new replies.