• Hi,

    i did search but couldn’t find a solution to my problem:

    I added WordPress to a static site, but already converted the index page to php.
    Now i’d like to display the title, author and excerpt on this index page, so it updates automatically with every new post. The post should be linked via the page-slug.

    Is there a way to accomplish this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.]

    I had a similar problem.
    You might take look at this topic which resolved my problem:

    https://www.ads-software.com/support/topic/73570

    Thread Starter world

    (@world)

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

    Thread Starter world

    (@world)

    Thank you very much for the hint!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘displaying links to newest blog articles on external page’ is closed to new replies.