• Hello there! I have a wordpress-site thats made out of some pages, like contact and about. I also have a page called ‘blog’. Here I want to display all posts, no matter what category, with the most recent at the top. How do I do this? I have a blog-template page, I can make. But I do not know what code should be on there, to show all posts that I will make.

Viewing 5 replies - 1 through 5 (of 5 total)
  • have you tried <?php the_content(); ?> ?

    Thread Starter steinumstein

    (@steinumstein)

    Hello Qbs, and others who might be listening in. This is my current code, for the template-page called page-blog.php:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml">
    	<head profile="https://gmpg.org/xfn/11">
    		<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    
    		<!-- Meta -->
    		<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    		<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    		<meta name="keywords" content="<?php bloginfo('description'); ?>" />
    		<meta name="description" content="<?php bloginfo('description'); ?>" />
    
    		<!-- Stylesheets, XML &amp; Pingback -->
    		<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory');?>/style.css" type="text/css" media="screen" />
    		<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    		<!-- Javascripts -->
    		<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/top.js"></script>
    		<script type="text/javascript">
    		<!--//--><![CDATA[//><!--
    		   function m(el) {
    		      if ( el.defaultValue == el.value ) el.value = "";
    		}
    		//--><!]]>
    		</script>
    
    		<?php
    		// Category Sort options
    		global $categories_sort;
    		if(get_settings('Shade_sortcategories')!='')
    		{
    			$categories_sort = 'sort_column='. get_settings('Shade_sortcategories');
    		}
    
    		// Exclude Categories options
    		global $categories_to_exclude;
    
    		if(get_settings('Shade_excludecategories')!='')
    		{
    			$categories_to_exclude = 'exclude='. get_settings('Shade_excludecategories');
    		}
    		?>
    		<?php wp_head(); ?>
    <?php wp_head(); require("config.php"); ?>
    	</head>
    	<body>
    		<div id="header">
    			<div class="header">
    				<a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_option('home'); ?>/wp-content/themes/shade/img/logo.gif" alt="Logo" /></a>
    <ul id="menu">
    <li><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <li><a title="Copyright information" href="https://www.manenburg.nl/blog/overons/">Over Ons</a><li>
    <li><a title="Copyright information" href="https://www.manenburg.nl/blog/watwedoen/">Wat We Doen</a><li>
    <li><a href="<?php echo get_category_link($blog_category_page); ?>">Blog</a></li>
    <li><a title="Copyright information" href="https://www.manenburg.nl/blog/contact/">Contact</a><li>
    </ul>
    			</div>
    		</div>
    		<div class="intro">
    			<div style="margin:0 auto; width:960px;">
    				<form class="search-header" method="get" style="margin:0px;" action="<?php echo get_option('home'); ?>/">
    					<input value="See what you can find..." onfocus="if(this.value == 'See what you can find...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'See what you can find...';}" style="margin:5px 0px 0px 10px;" type="text"  name="s" id="s" size="19" class="search-top" />
    					<input type="image" src="<?php echo get_option('home'); ?>/wp-content/themes/shade/img/spacer.gif" style="margin:0px; padding:0px; border:0px;width:30px;height:30px;" />
    				</form>
    				<div class="intro-title"><?php the_title2('', '', true, '46') ?></div>
    			</div>
    		</div>
    		<div id="container">
    			<div id="wrapper">
    				<?php include 'sidebar.php';?>
    				<div id="content" class="narrowcolumn">
    				<?php if (have_posts()) : ?>
    					<?php $post = $posts[0];  ?>
    					<div class="post">
    						<div class="entry">
    						<?php while (have_posts()) : the_post(); ?>
    							<div style="text-align:justify;">
    								<?php the_content(); ?>
    								<?php comments_template(); // Get wp-comments.php template ?>
    						<?php endwhile; ?>
    							</div>
    						</div>
    					</div>
    				<?php else : ?>
    					<?php include (TEMPLATEPATH . '/notfound.php');?>
    				<?php endif; ?>
    				</div>
    <?php get_footer(); ?>

    I don’t know if this is right, or wrong. I do not really know what it does! I tried replacing the part from if have_posts to endinf with what you said, but that didn’t work. I have no clue as to what I need to do. I hope anyone else does!

    Have you set up WP (using the admin’s panel) to show your posts on that particular page? I think it’s in Settings -> Reading -> Posts Page

    Thread Starter steinumstein

    (@steinumstein)

    Hello Qbs, I tried what you said, but it turns my ‘contactpage’ (I used this for testing) into the same page as my home.php! My site is here. I think there is a problem with my theme though. Would you be willing to take a look in my dashboard? I don’t know what to tell you about what’s wrong, and how I’d want it to be fixed, I think, I simply don’t know what the problem is, only what I would like the solution to do. If you know, what I could try, please tell me. I think a look at my theme (I could mail it, or could show you how to log in to my dash) would otherwise be the best answer.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘template page that displays all posts’ is closed to new replies.