Fetching specific single posts from Blog
-
Hello there,
i am trying to fetch some single post from the Blog without using the Loop. It worked for following:
<?php $custom = array('numberposts' => 1, 'offset' => 0,); get_posts($custom); ?>
Now i display the title, excerpt and make us of the permalink. After that i reset the postdata
<?php wp_reset_postdata(); ?>
With this code i get always the latest posts from my wordpress. The Problem is i want also the next two posts in a new section of the site (chronological).
I tried it with numberposts=2 offset 1 but this gives me also the latest post.Does anyone know how i have to modify my querry to get it work?
Short Example of Use Case:
For example three containers on landing page without Blog.
Container 1: Article 1 at 5/10/2014
Container 2: Article 2 at 6/10/2014
Container 3: Article 3 at 7/10/2014
and Article 4 at 4/10/2014 shouldn’t be fetched.I would use a loop but the containers are all diffrent which would lead to a complete css overwork.
Thank you in anticipation for your replies ??
- The topic ‘Fetching specific single posts from Blog’ is closed to new replies.