0

I´m making a pseudo-static page that drives me loco.

The structures is:

  • index.php --> with a footer that displays last 5 post title
  • services.html --> this is pure static
  • portfolio.html --> this is pure static
  • blog.php --> this is the WP zone (http:/www.domain.com/blog)
  • contact.html --> this is pure static

I better explain what I have:

In index.php

<?php 
/* Short and sweet */
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
?>
<--- HTML --->
<h3>Recent Post</h3>                            
<?php get_archives('postbypost', '5', 'custom', '<li>', '</li>'); ?>
<--- HTML --->

In page-blog.php

<?php 
/* Short and sweet */
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
?>
<--- HTML --->
<div class="span9">
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box is given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>

<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

<!-- Display the Post's content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>

<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->

<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>

<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display.  This "else" part tells what do if there weren't any. -->
<p>Sorry, no posts matched your criteria.</p>

<!-- REALLY stop The Loop. -->
<?php endif; ?>
</div> <!--cierra span 9-->

<div id="sidebar" class="span3">
<?php get_sidebar('right'); ?>
</div>

</div> <!-- /span 9-->
<--- HTML --->

The thing is that I´ve make the blog work, you can see the 5 post title in footer of the index.php, and can see the 5 post in the main blog.php file (with the global site style). But I can´t see each post individually. I would like to display the posts "in the same way" I have the blog.

I´ve been following several tuts and tricks but I´m not a programmer. I´ve read something about make a page into WP and link but didn´t work. I think the problem could be in the permalinks structure, but at this point I´m totally confused.

2
  • This is going to be hard to figure out without more information about how this all works. Things should mostly work automagically so you must have done something unusual.
    – s_ha_dum
    Nov 15 '13 at 23:44
  • Hi again. I´ve just bought a theme to make things easy. I´ve spend three days in trying to make this previous thing working with no luck, so I think it´s better to buy one and spend time adding content. Thanks for your time! Nov 16 '13 at 11:30
0

Create single.php in your themefolder and insert this code

get_header(); ?>

<div id="primary" class="content-area">
    <div id="content" class="site-content" role="main">

        <?php /* The loop */ ?>
        <?php while ( have_posts() ) : the_post(); ?>

            <?php get_template_part( 'content', get_post_format() ); ?>
            <?php twentythirteen_post_nav(); ?>
            <?php comments_template(); ?>

        <?php endwhile; ?>

    </div><!-- #content -->
</div><!-- #primary -->
1
  • That´s the single.php itself from the Twenty Thirteen theme... Didn´t work. Nov 16 '13 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.