WordPress.org

Ready to get started?Download WordPress

Forums

implement wordpress in own site (4 posts)

  1. m.schalkx
    Member
    Posted 2 years ago #

    I'm new to wordpress and i'm trying to integrate it in my existing site.

    To do so i'm using the following code:

    <?php
    $args = array( 'numberposts' => 1 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?><?php the_content(); ?><?php endforeach; ?>

    This does the trick, but now i would like to only have posts of a particular categorie be shown. So i tried to add 'category' => 3 to the $args = array line. But if i do so, nothing shows up (and there are posts in this categorie). Any ideas why this is?

    Also, in this case, i would like to only have the image of the post be shown, so no title, date (i already removed <?php the_title(); ?> and <?php the_date(); ?> so that wont show up), but the permalink and excerpt arte still there and don't have their own <?php> tag in the code as seen above.. So can this be done?

    The site im talking about http://www.moschalkx.nl/index1.php

    Or does anyone know a good step by step information source for implementing wordpress in to your own site? Information in wordpress codex is a bit complex for me at this point.

    Greets!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. m.schalkx
    Member
    Posted 2 years ago #

    Hi esmi thank you for replying,

    I've red that page, knew about it. But it doesn't say anything about categories or showing only the picture of a post. Do you know how i should go about that?

    with themplates? or can i edit some .php page inside wp that makes up the way the information is shown when i use this code

    <?php
    $args = array( 'numberposts' => 1 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?><?php the_content(); ?><?php endforeach; ?>

    Is there more documentation about this?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic