Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

jasperg on "Create a list of posts with topic heddings"

$
0
0

I hope this question makes sense.

I am designing a page for a second hand bookshop, It will be linked to in a weekly email newsletter containing that weeks books added to the store, so subscribers can keep updated on rare books that are available.

At the moment this is sent out as a pdf organised in broad categories. eg history, archaeology, antiquarian etc. With about 50-70 books on it.

The website I am building use a custom taxonomy to allow browsing of book categories.

For my weekly updates page I really need to have all books listed on one page with a heading for each category.

So using;

$args = array(
	'date_query' => array(
		array(
			'column' => 'post_date_gmt',
			'after' => 'Monday 1 week ago',
		),
	),
	'posts_per_page' => -1,
	'post_type' => 'product',
);

writing a loop that gets all books added after last monday if fine. But after reading http://wordpress.stackexchange.com/a/14309/53985 it seems that taxonomies are not a good way of listing posts like this. It seems I can do it but will have to;

  1. Get the top level taxonomies.
  2. for each taxonomy find all books added 'after' => 'Monday 1 week ago'
  3. If there are any new books in that taxonomy publish the title and the list of books.
  4. repeat for all taxonomies.

I am not sure exactly how to do this, and I am even less sure it is a good idea. Seeing as the list will go out to subscribers, it will probably be the most visited page on the site and peak the usage of the website as a whole each day the email is sent out (as everyone checks for new arrivals on the same day) and using complicated multiple loops may slow the page down???

So my question. Is this a good way of doing it? Will it be ok as there will only be ~50 posts to go through each time? or should I be looking at some other method?

Maybe I should add a custom meta field "Topic" to each book listing that is the same as each top level taxonomy and use this field to sort my book list? Would this be an improvement? Would that make it faster / easier? If I do this, and order the books by my Topic field. Would it be possible echo out the topic each time a new category starts as a title for each set of books, or would I have to echo the topic in each post, so people can see what category it belongs to?

Thank you for taking the time to read this. I know it is a rather complicated question, and I really appreciate any advice anyone can give me.


Viewing all articles
Browse latest Browse all 8245

Trending Articles