Recently I finished custom work for a gentleman that involved creating a Page Template in Genesis that shows Posts in tabular format grouped by their categories with sorting and search options available in the front-end.
Requirements:
- Displays Posts from each category organized by category with the categories in ascending order.
- Within each set of categories, latest Posts should be shown first i.e., sorted by date in descending order.
- Each set should be displayed as a Data Table with sorting, filtering via a search (as you type field) capabilities.
- Each category table should have these columns:
Post title (link) | Author | Date | Tags (links) | Views - Category tables need to show first 25 items with pagination option.
- Language to be in Spanish
- Be able to apply this Page Template to different Pages and limit the output to specific category/categories using a custom field such as query_args, similar to how it's possible when using the Blog Template that comes with Genesis.
In this article I am sharing the result of my half a day's research and trial & error on putting together the 'Category Tables' solution.
Step 1
Download DataTables and extract the contents.
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Brilliantly done! đŸ™‚
Thanks for sharing, Sridhar.
If i wanted to add a 75×75 featured image to this on the left side how might i do that?
i tried adding
%POST_THUMBNAIL|75×75%
to it but no go
[…] For another example, check out How to display Posts organized by category as Data Tables in Genesis. […]
After reading my own question, i wanted to restate.
I would like to show the featured image of the related post in each row!
Thanks for the help
http://pastebin.com/raw.php?i=izWvd9WT
Source: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Thumbnail_Sizes
Thanks, worked great and the resource was helpful đŸ™‚
Hi Sridhar
Once more, very good post, very well done in Genesis standard. I’ll suscribe to your site today đŸ™‚
I wonder if it is faster if you register and you enqueue scritp in a functions.php file with a conditionnal only for a particular template.
Cheers
Thanks as always Sridhar!! This is just exactly what I need but I’m dealing with two difficulties. First I need to show the post ordered by date but I don’t want to show the date. I have commented out in datatables-init.js the linres where it say order [[2, asc]] so it dosen’t order this way and in the template file I have put this <?php
$args = array(
'orderby' => 'date',
'order' => 'DESC',
but it does nothing.
Also I have two custom fields I want to show. Say one is named HD. I want to show that in one column and I have added
ID, 'HD', true); ?>
Again it shows nothing. Do you know what can I be doing wrong? Thanks again!!
The code is ID, ‘HD’, false); ?>
Hi Sridhar.
A good job. I like your job so much.
I want to use this, but I have a problem. Is you sort by date, only sort by day, but not for mont, year… Example: Order Asc:
1 noviembre, 2014 10 octubre, 2014 13 noviembre, 2014 13 octubre, 2014 2 octubre, 2014
Any solution or format for Get_the_date ();???
Thanks a lot.