DEV Community

web programming

Kelvince on November 03, 2018

Need a pagination for my website
To output one post only in the home page

Collapse
 
pgrab86 profile image
Paweł Grabowski • • Edited

Has your website any CMS? Any framework? What's the technology used to build it?

Collapse
 
kelvince profile image
Kelvince •

Used php,sql,html,js and css
Only

Collapse
 
pgrab86 profile image
Paweł Grabowski •

Don't know, what exactly you need, but maybe a simple slider would work. Get 5 posts from database and use slick for example (kenwheeler.github.io/slick/) with dots (you can style it as numbers).

Thread Thread
 
kelvince profile image
Kelvince •

Some sort of that.
Exactly what i need is pagination in php, where it will display one recent post from the database only in the homepage and display the previous post as a link

Thread Thread
 
pgrab86 profile image
Paweł Grabowski •

So the same for me. Get a few posts (or partial of posts like thumb, short description, id and slug), and in a loop make a condition: if first - show article (part of article) and if next - put just links. So you have to generate links by slug or by id (no idea, what your database looks like).

Thread Thread
 
kelvince profile image
Kelvince •

Yeah this but display the post body for one post

 
kelvince profile image
Kelvince •

mysql_query()

 
kelvince profile image
Kelvince •

Saw the code near to what i wanted,thanks

Collapse
 
kelvince profile image
Kelvince •

Using php,getting the posts from the database