[Plugin: List category posts] Displaying posts for specific date range
-
I am really strugling with this but need to say that I am also a novice with regard to templates etc!
I am using the Theme Graphene AND have a child theme which seems to be working.
I am also using the plugin No Future Posts which allows the display of Posts published in the future.
On one of my pages I wish to display:
Heading Future Posts
catlist etc
Heading Past Posts
catlist etcI have found some code that appears to allow this.
Future
get_header();// gets all posts in the future
function kurse_where($where = ”)
{
$where .= ” AND post_date >= ‘”.date(‘Y-m-d’, strtotime(‘+0 days’)).”‘ “;
return $where;
}
add_filter(‘posts_where’, ‘kurse_where’);// parameter: only catagorie “Concerts” and normal order: past top, future down
query_posts(“category_name=Concerts&order=asc”);// here the normal code like index.php to list the posts
Past
get_header();// gets all posts in the past
function kurse_where($where = ”)
{
$where .= ” AND post_date <= ‘”.date(‘Y-m-d’, strtotime(‘+0 days’)).”‘ “;
return $where;
}
add_filter(‘posts_where’, ‘kurse_where’);// parameter: only catagorie “Concerts” and normal order: past top, future down
query_posts(“category_name=Concerts&order=desc”);// here the normal code like index.php to list the posts
<?phpI think I understand these 2 sets of code and where to save the resultant template file. BUT I have no idea where or within which of the several php files that I can find:
list_cat_posts.php
default.php
child_theme.phpPlease can anyone help a struggling beginner?
https://www.ads-software.com/extend/plugins/list-category-posts/
- The topic ‘[Plugin: List category posts] Displaying posts for specific date range’ is closed to new replies.