English 中文(简体)
Creating a Archive in Wordpress Datewise for a Particular Category
原标题:

In my site i would like to add a archive page or a custom page where i want to show posts from a particular category and that with a date wise format

like for example: i am in category : Technology All post of a day will be shown at this page like i have written 3 posts only on that day.

The next page from navigation would be the previous date page .. which will show all posts from the previous day like 6 posts and so on

Example Page where I have seen this Functionality is : http://www.thedailybeast.com/cheat-sheet/

i want to show them in Title, little excerpt format ..

i think its possible with a custom page format ..

Hopefully i can get a quick response .. thnx

问题回答

you can probably either use your archive.php file or make a custom template file then use query_posts. See: http://codex.wordpress.org/Template_Tags/query_posts

I would look at Example 2 under "Passing variables to query_posts" Something like this should work.

    <?php

$current_day = date( d );
$current_month = date( m );
$current_year = date( Y );

query_posts("cat=22&year=$current_year&monthnum=$current_month&day=$current_day&order=ASC");
?>
<!-- put your loop here -->




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签