Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks a lot, Geoffe.

    Sorry 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?

    Thread Starter world

    (@world)

    Thank you very much for the hint!

    Thread Starter world

    (@world)

    sorry, please ignore $do_not_duplicate = $post->ID;

    Thread Starter world

    (@world)

    Thanks 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.]

Viewing 5 replies - 1 through 5 (of 5 total)