• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wordpress-like post short by date

#1
Hello, im working on a new project and i want to make a blog. The main blog is pretty simple. Just pulling the posts from the database. However i would like to have a wordpress-like short by date system. I f you dont know how it looks like take a screenshot:

[Image: archives-page.png]

It shorts the posts by month and year. The posts table is already keeping the creation date so i just have to process them.
I could make a model which gets all the posts from a specific month/year but i dont know how to display them like above. Any suggestion?
Reply

#2
(12-07-2014, 07:35 AM)FlevasGR Wrote: Hello, im working on a new project and i want to make a blog. The main blog is pretty simple. Just pulling the posts from the database. However i would like to have a wordpress-like short by date system. I f you dont know how it looks like take a screenshot:

[Image: archives-page.png]

It shorts the posts by month and year. The posts table is already keeping the creation date so i just have to process them.
I could make a model which gets all the posts from a specific month/year but i dont know how to display them like above. Any suggestion?

It seems that they are displayed in a bulleted list, of type ul (unordered list).

Is that what you were asking?
Reply

#3
I'm asking how to short the posts by month.
Reply

#4
You have to do this in your sql query by a order by clause over you date-field (date insert) witch must be a date datatype (date, datetime, timestamp).

PHP Code:
select [...] from table order by date_insert [asc|desc

Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.