WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display 1 recent post from each category (14 posts)

  1. jknetdesign
    Member
    Posted 11 months ago #

    How do I control the number of posts display on the blog page but I only want 1 post visible on each category page?

    In relation to the last question: How can I display 1 post from each category on the blog page. I only want each recent post to be displayed.

  2. Mindstien Technologies
    Member
    Posted 11 months ago #

    Here is the plugin for your requirement.....

    http://wordpress.org/extend/plugins/recent-posts-from-each-category/

    Let me know how you like this and if any suggestion....

    Thanks.

  3. jknetdesign
    Member
    Posted 11 months ago #

    Thank you so much.
    I have built a page template with the proper code to achieve this functionality, but I definitely saved your plugin.

    Let me know if you're interested in my page template.

  4. filipinoblogger
    Member
    Posted 11 months ago #

    Hi jknetdesign,

    Would you mind sharing your page template? I'm looking into same solution of displaying all my categories at the homepage... It would save me a lot of time creating the template from scratch:)

    Thanks!

  5. Mindstien Technologies
    Member
    Posted 11 months ago #

    Hi, Have you tried this plugin ?

    http://wordpress.org/extend/plugins/recent-posts-from-each-category/

    If you have any issue/suggestion in using this plugin, please let me know, I would be more than happy to help you on this.

  6. jknetdesign
    Member
    Posted 11 months ago #

    Sure ill send it when I return.

  7. jknetdesign
    Member
    Posted 10 months ago #

    <?php
    /**
     * Template Name: First Post Category
     *
     * This template display the first post from each selected category.
     *
     */
    
    get_header(); ?>
    
        <div id="primary" class="site-content">
            <div id="content" role="main">
    
    <!-- Latest from Each Category (add your own use commas to separate) -->
    <?php query_posts(
                array('category_name'=>"IconoCraft, Poetry, Opinion, Karma, Zen Shin Progress",
                'showposts'=>5,
                'order'=>DESC)
          ); ?>
    
        <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
    
        <!-- Entry Title -->
        <div class='cat-entry'>
            <header class="entry-header">
                <?php if ( is_single() ) : ?>
                <h1 class="entry-title"><?php the_title(); ?></h1>
                <?php else : ?>
                  <?
      	$cats = wp_get_post_categories($post->ID);
    	$cat_name = 'Unknown';
    	if($cat = array_shift($cats)) {
    		$cat = get_category($cat);
    		$cat_name = $cat->name;
    	}
      ?>
    
                <h2 class="archive-title"><?php printf( __( 'Featured Post: %s', 'twentytwelve' ), '<span>' . $cat_name . '</span>' ); ?></h2>
                <div class='cat-entry-thumb'><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?></a></div>
                <h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    
                <?php endif; // is_single() ?>
    
            </header><!-- .entry-header -->
    
        <!-- Entry Content -->
            <div class="entry-content">
                <?php the_excerpt( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
                <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
            </div><!-- .entry-content -->
             <?php if ( comments_open() ) : ?>
                    <div class="comments-link">
                        <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
                    </div><!-- .comments-link -->
                <?php endif; // comments_open() ?>
    
    	</div>
            <?php endwhile; ?>
        <?php endif; ?>
        <!-- End of Category Display -->
    
            </div><!-- #content -->
        </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  8. filipinoblogger
    Member
    Posted 10 months ago #

    @jknetdesign
    Thanks for sharing, I'll be playing with it once I'm done adding some content:)

    @Mindstien Technologies
    Your plugin is a good one but I'm a little concerned about the styling. One question though, is the boxed layout default?

  9. Mindstien Technologies
    Member
    Posted 10 months ago #

    yes, boxed layout is default, however, I would like your suggestion to improve the plugin for you and other users...

  10. jknetdesign
    Member
    Posted 10 months ago #

    CanI see an example of the plugin in action?

  11. filipinoblogger
    Member
    Posted 10 months ago #

    My site is not live yet, I'm still in a development phase under WAMP. I'll provide the link maybe in a week or two.. Thanks!

  12. Mindstien Technologies
    Member
    Posted 10 months ago #

    @jknetdesign

    The exmample in action at fungujarati.com, its in gujarati language but you can see the look on homepage (boxed layout).

    THanks.

  13. GeorgeEadie
    Member
    Posted 2 months ago #

    Hi, I really like your plugin Mindstein.
    I appears to be repeating on my page. Can you help? I only want 1 post from 1 category to show.
    http://www.humanexplorer.co.za

  14. Mindstien Technologies
    Member
    Posted 2 months ago #

    Hey @GeorgeEadie

    Thanks for using the plugin, you might be using both shortcode and auto insert facility , check the plugin settings for it...

    THanks.

Reply

You must log in to post.

About this Topic