world
Forum Replies Created
-
Forum: Plugins
In reply to: The PHP code for the last 5 postsThanks a lot, Geoffe.
Forum: Plugins
In reply to: The PHP code for the last 5 postsSorry folks, I have to reopen this thread:
My problem as an absolute PHP-newbie is, that I can’t get anything posted here to work.
I guess this is because i try to call the db from a (home)page outside of wp, which itself has been added to the site later and is installed in a subdirectory named ‘blog’.
I should be able to call the wpdb from outside of WordPress, right? My table-prefix is ‘wpde01_’.
I only want the last post being displayed with headline and excerpt and linked via the page-slug. Unfortunately the excerpt has to be shortened, too, so using RSS isn’t an option.
Any nice person around willing to support a newbie?
Forum: Fixing WordPress
In reply to: displaying links to newest blog articles on external pageThank you very much for the hint!
Forum: Fixing WordPress
In reply to: displaying links to newest blog articles on external pagesorry, please ignore
$do_not_duplicate = $post->ID;
Forum: Fixing WordPress
In reply to: displaying links to newest blog articles on external pageThanks for that link. I read as much as i found and came up with the following solution, which results in an empty page. Without that code the page is rendered fine and all phpincludes are rendered, too
Btw. WordPress is running in a subdirectory, might this be the problem? I don’t know how to pass parameters to WordPress from an external page.
Anyway, here’s what I came up with:
<p class="tease"><!-- loop -->
<?php if ( have_posts() )?: while ( have_posts() )?: the_post();??><!-- no styling -->
<?php define('WP_USE_THEMES', false); ><!-- display last post once -->
<?php $my_query = new WP_Query('category_name=general&showposts=1');
while ($my_query->have_posts())?: $my_query->the_post();
$do_not_duplicate = $post->ID;??><!-- create linked text, styled title -->
<a href="blog/<?php the_permalink(); ?>"
<span class="subheadsmall">
<?php the_title(); ?>
</span><br>
<?php the_excerpt(); ?>
</a><!-- loop end -->
<?php endwhile; ?>
<?php endif; ?>
</p>Any hint on how to fix this code or accompülish this task will definitely raise your spam karma ;o)
[I guess calling WordPress from the outside could be a reoccuring problem, therefore an article in the codex would probably make sense, too.]