I want to include some latest Wordpress Blog Posts on the home page of a site. I do not want the home page to be .php
Therefore I have created a simple php page in the blog folder (wpress) called 'hereiam.php' containing the following code:
And it works nicely displaying the recent posts and their featured images.
However if I put this in the home page:
Sellerdeck adds 'acatalog' and I get this:
I know how to get round this with js using apostrophes and + but I don't know how to do the same sort of thing with php.
Please can anyone help?
Thank you
Jonathan
Therefore I have created a simple php page in the blog folder (wpress) called 'hereiam.php' containing the following code:
Code:
<meta charset="utf-8"> <?php require('wp-blog-header.php'); /*if you are getting 404 errors uncomment the next 2 lines*/ //status_header(200); //nocache_headers(); ?> <?php $posts = get_posts('numberposts=20&order=DESC&orderby=post_date'); foreach ($posts as $post) : setup_postdata( $post ); ?> <h5 class="blogh5"><?php the_time('l, F j, Y'); ?></h5> <a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a> <p class="product-image"><?php the_post_thumbnail( $size, $attr ); ?></p> <?php the_excerpt(); ?> <p></p> <a href="<?php the_permalink(); ?>"><p>Read More...</p></a> <?php endforeach; ?>
However if I put this in the home page:
Code:
<actinic:block php="true"> include '/wpress/hereiam.php'; </actinic:block>
Code:
Warning: include(/wpress/hereiam.php): failed to open stream: No such file or directory in main on line 2 Warning: include(): Failed opening 'acatalog//wpress/hereiam.php' for inclusion (include_path='.;C:\php\pear') in main on line 2
Please can anyone help?
Thank you
Jonathan
Comment