WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] NexGEN and Category Posts (2 posts)

  1. TheExpertNoob
    Member
    Posted 6 years ago #

    Here is my predicament: I want to mix the display of Posts from a category with a NexGEN Album.

    I can create a Category Template or a WordPress Page Template.

    I just don't know how to call a NexGEN Album (WordPress syntax:[album=1,extend]) in a Category Template or how to display posts from a category in a WordPress Page Template.

    reason being, I want the last 3 posts in that category to display followed by the NexGEN Album content.

    Help Please!

  2. TheExpertNoob
    Member
    Posted 6 years ago #

    I solved this myself by creating a custom template for my page and inserting this code:

    <?php
    $lastposts = get_posts('numberposts=3&category=7');
    
    foreach($lastposts as $post) :
        setup_postdata($post);
        ?>
        <a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
        <?php the_content(); ?>
    <?php endforeach; ?>

    This will show the last 3 posts of category ID 7

    EDIT: oh yea, and before The Loop

Topic Closed

This topic has been closed to new replies.

About this Topic