Just remembered to check this thread. Sorry for the delay, Here’s how I do it…
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('../empire/wp-blog-header.php');
query_posts('showposts=10');
?>
</head>
that bit of code goes just above the closing </head> as I’ve shown, some folks say it goes at the VERY top of your page…. but, that didn’t work for me, it works perfectly where I have it. Notice I have ../empire
two dots, you probably don’t need that. My WP is in a subdirectory, so I had to back out of that, that’s why I have the extra dot. Also, the file you are trying to attach to WP is a .php file correct? It can’t be .html, but it’s as simple as renaming it to .php and possibly adding this to a .htaccess file to tell browsers to use index.php rather than index.html
DirectoryIndex index.php index.html
Now, if you only want to use a certain category, you just include that in the above code here:
query_posts('showposts=10');
https://codex.www.ads-software.com/Function_Reference/query_posts
so, an example: query_posts('showposts=10&cat=4');
returns 10 posts in category 4
so that sets up calling the posts…but nothing is displayed yet, so you just need to build a loop. That goes in the <body> section of your webpage somewhere, here’s my loop:
<div id="voodoorss">
<?php while (have_posts()): the_post(); ?>
<div class="dateIcon">
<h5><?php the_time('M'); ?></h5>
<p><?php the_time('j'); ?></p>
</div>
<div class="text">
<h4><?php the_title(); ?></h4>
<div class="thumb"><?php the_post_thumbnail(); ?></div>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read More...</a>
</div>
<br />
<?php endwhile; ?>
</div>
That just displays the date in an icon, the title, the excerpt, a thumbnail, and the Read More as a link back to my blog