• Resolved dizzy100

    (@dizzy100)


    Ok heres the problem.

    I have made a new page template like so

    <?php /* Template Name: Blog */ ?>
    <?php get_header(); ?>
    <?php query_posts('cat=17'); ?>
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    
    			<div class="post-main">
    				<h2 class="post-title">
    					<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>"><?php the_title(); ?></a>
    				</h2>
    
    				<div class="post-entry">
    					<?php if (is_search()) { ?>
    						<?php the_content('more_link_text', strip_teaser, 'more_file'); ?>
    					<?php } else { ?>
    						<?php the_content(__('Read the rest of this entry &raquo;')); ?>
    					<?php } ?>
    				</div>
    
    				<!--
    				<?php trackback_rdf(); ?>
    				-->
    
    			</div><!-- End of .post-main -->
    
    		</div><!-- End of .post -->
    
    		<?php endwhile; ?>
    
    			<!-- Page Navigation -->
    			<?php if (function_exists('wp_pagenavi')) : ?>
    				<div class="pagenavi">
    					<?php wp_pagenavi(); ?>
    				</div>
    			<?php else : // Use WordPress default page navigation. ?>
    			<div class="pages">
    				<span class="older"><?php next_posts_link('&laquo; Older Entries'); ?></span>
    				<span class="newer"><?php previous_posts_link('Newer Entries &raquo;'); ?></span>
    			</div>
    			<?php endif; ?>
    
    	<?php else : ?>
    
    		<div class="post-main">
    			<h2 class="post-title"><?php _e('404 - Not Found'); ?></h2>
    			<div class="post-entry">
    				<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    			</div>
    		</div>
    
    	<?php endif; ?>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Assigned that page template to a new page entitled blog and created a new category called blog (which has the id of 17)

    Now when i post blog entries within the blog category they show through that page and act like a normal blog.

    The only problem i have is getting the <strong><!-- more --></strong> tag to excerpt the blog posts. Currently it refuses to excerpt the post where i define and shows the entire blog post one after another.

    It doesn’t seem to parse whatever I do within that page although ironically if I set the posts page to blog in the wordpress options panel it does indeed then work as it should, so I know the template is right.

    This would work ok but i wanted to create another page similar to this for news.

    Anybody any ideas what I’m doing wrong and how i can get this template page to parse that <strong><!-- more --></strong> tag ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dizzy100

    (@dizzy100)

    Mmmm anybody ?

    I have been searching and searching through the forum because I couldn’t believe there wasn’t something like a ‘blog within a blog’ in WordPress. What I wanted was to have a normal blog on my frontpage and then another page filled with articles.

    It seems you are on to something with this new page template. I tried to do the same thing on my page, but I couldn’t figure out how to assign that page template to a new page, like you did? Can you help me out here? Also if somebody else has a better solution for this blog within a blog problem please let me know!

    I found this in the FAQ and I think I got it all sorted out: Why is there no Page Template option when writing or editing a Page

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog posts within a page template’ is closed to new replies.