Title: bernk's Replies | WordPress.org

---

# bernk

  [  ](https://wordpress.org/support/users/bernk/)

 *   [Profile](https://wordpress.org/support/users/bernk/)
 *   [Topics Started](https://wordpress.org/support/users/bernk/topics/)
 *   [Replies Created](https://wordpress.org/support/users/bernk/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/bernk/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/bernk/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/bernk/engagements/)
 *   [Favorites](https://wordpress.org/support/users/bernk/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to mark first and last post while only getting one category?](https://wordpress.org/support/topic/how-to-mark-first-and-last-post-while-only-getting-one-category/)
 *  Thread Starter [bernk](https://wordpress.org/support/users/bernk/)
 * (@bernk)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/how-to-mark-first-and-last-post-while-only-getting-one-category/#post-1009392)
 * Thanks Michael.
    Do you have a better way to achieve this?
 * I’ll try to describe what I’m trying to achieve a bit better, and hopefully clearer.
   I really need help with this as this will be my first WP theme.
 * The website I’m converting to use WP is [http://balsi.be/home](http://balsi.be/home)
   
   The idea is for the WP theme to look and behave almost identical to what you 
   see there.
 * As you can see, there is a large header image which pertains to the most recent
   post, “vom Ball zum Pögg”. Each post has one associated header image with it.
   If I click on an older post, e.g. “Balsi gewinnt Krebsliga-Pitch” it should open
   that post in the single view, with that post’s header image displayed, and no
   other posts displayed.
 * The way I’ve set this up so far is to have a “news” category for posts where 
   you write new posts and attach one image to them, not actually embed into the
   post but just attach. Then on the home page I get the attachment of just the 
   most recent post and show it in the header. Make sense so far? I hope so.
    This
   part I have achieved fully.
 * The problem: I also need to have a category for projects. If you go to [http://balsi.be/portfolio](http://balsi.be/portfolio)
   you will see what this will look like.
    So, the idea is to have a page which 
   shows a thumbnail of each project there is. For simplicities sake let’s say each
   project also only has one image attached, and so has a thumbnail available to
   us. Then when I click on a project thumb I should be taken to a special single
   view for projects where I can read about the project, see the image, and jump
   to other projects.
 * Please keep in mind the site I’m showing you here is NOT WordPress, it is just
   custom PHP/HTML.
 * So in summary, I need to find a way to do all of the following:
 * 1. Display the image attached to the most recent news post on the home page.
   
   2. Show only the posts belonging to the news category on the home page. 3. Style
   the last shown news post differently then the others. 4. Show only the posts 
   belonging to the projects category on the portfolio page (or category or whatever
   I should be calling that)
 * I’ve been going over the documentation a ton but I’m new to this and could really
   use some help.
 * Thank you for reading and trying to help!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Make sure posts only display from certain category](https://wordpress.org/support/topic/make-sure-posts-only-display-from-certain-category/)
 *  [bernk](https://wordpress.org/support/users/bernk/)
 * (@bernk)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/make-sure-posts-only-display-from-certain-category/#post-987626)
 * Holy that was easy! Thank you : )
 * I’ve been trying to achieve this for the last 30 minutes.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Get ID of latest post](https://wordpress.org/support/topic/get-id-of-latest-post/)
 *  [bernk](https://wordpress.org/support/users/bernk/)
 * (@bernk)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/get-id-of-latest-post/#post-918671)
 * Hey,
 * I just hit a similar problem. I need to have the ID of the most recent post at
   my disposal. Found this thread while searching for an answer.
 * I just figured it out on my own! Here’s how for anyone else looking:
 * `$newest_post_id = $posts[0]->ID`
 * I’m not sure if this is sketchy or not, but it works!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How does one target images in a subdirectory of the theme’s root?](https://wordpress.org/support/topic/how-does-one-target-images-in-a-subdirectory-of-the-themes-root/)
 *  Thread Starter [bernk](https://wordpress.org/support/users/bernk/)
 * (@bernk)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/how-does-one-target-images-in-a-subdirectory-of-the-themes-root/#post-999047)
 * Oops, should have checked back in here sooner! I did indeed find that bloginfo(‘
   template_directory’) works. There are some depricated tags though, so it makes
   a it a bit confusing when you find older sollutions on other sites…
 * Thanks anyway for all the replies!
 * [@t31os](https://wordpress.org/support/users/t31os/): I don’t think a relative
   path works in this case because of how WP includes your template files. I think.
   
   even though to your index.php file your images folder is in the same place, when
   you target an image in that folder using something like images/myphoto.jpg it
   won’t work.
 * By the way, is this all I need to do in order to successfully embed Flash? Or
   are there some other things I need to be aware of?
 * I’m a total noob to WP, but I know my way around PHP ok.

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