• Is there a plugin that allows you to embed the posts of a certain category into a specific page? If there isn’t already a plugin that does this I’ll write one as long as I can get some direction. It’s my first time working w/ the WP API but have good knowledge of PHP.

    In short, here’s what I’m looking to do:

    Without Plugin:
    News Page
    ? News Page Text
    ? (blank)

    With Plugin:
    News Page
    ? News Page Text
    ? News Category Post
    ? News Category Post
    ? News Category Post
    ? etc.

    I saw a plugin that does something similar but requires that you add the post ID to the text field of the page. I need it to be more dynamic than that, automatically pulling in all posts from the category. Any help would be greatly appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • did this just last night.. heres what you need. make a new page with this code.

    <?php
    /*
    Template Name: Main
    */
    ?>
    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    
    <?php $temp_query = $wp_query; ?>
    <?php query_posts("cat=4&showposts=1"); ?>
    
    <?php while (have_posts()) : the_post(); ?>
      <div class="post" id="post-<?php the_ID(); ?>">
    
      <center><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2></center>
    
     <div class="entry">
       <?php the_content('Read more &raquo;'); ?>
     </div>
    	</div>
    <?php endwhile; ?>
    
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    change the <?php query_posts(“cat=4&showposts=1”); ?>

    to which category and how many post you want to show on that page..

    then when writing the page you want your category to show up on .. just select that template instead of the default one.

    Thread Starter old_scarf

    (@old_scarf)

    Awesome, interesting. I’ll give this a try. Two quick questions:

    1.) Is there a value for “showposts” that will in effect show all?
    2.) Can these posts be set as “private” and still show up in this query?

    Hi, I hate to be a complete newbie… but I am getting a fatal error because the wordpress functions (first, get_header()) are not found. How do I create a PHP page like this? Then, how do I add my page content that comes before the posts.

    I have post.php templates in my theme, page.php templates in my theme… etc. They all look similar to this… but how do I tie this into the wordpress interface? Thanks so much!

    Hi,
    Maybe my blog-in-blog plugin is what you are after?
    https://www.ads-software.com/extend/plugins/blog-in-blog/

    Thanks
    Tim

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Embed Category Posts into Page?’ is closed to new replies.