WordPress.org

Ready to get started?Download WordPress

Forums

how to generate posts by id ? (1 post)

  1. thirsty.bunny
    Member
    Posted 2 years ago #

    hello i have a question please
    how can i create page contain form with 2 inputs
    in first input " Please insert post Id"
    in second input " please insert post Id"

    with "Generate Button"
    on click , display custom layout i will do it
    but it will be dynamic

    <?php // retrieve one post with an ID in  first input
    query_posts('p=?'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php endwhile;?>
    <?php // retrieve one post with an ID in  second input
    query_posts('p=?'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php endwhile;?>

    thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.