Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Created June 7, 2012 00:39
Show Gist options
  • Save mikeschinkel/2885760 to your computer and use it in GitHub Desktop.
Save mikeschinkel/2885760 to your computer and use it in GitHub Desktop.
/comic/{$chapter_slug}/{$post_slug}/ -> display a post whose parent is a chapter
/feed/ -> displays 'post' and 'comic'
/comic/feed/ -> displays 'comic'
/comic/{$chapter_slug}/feed/ -> displays all comic posts for a chapter?
/comic/{$year}/ -> displays all comic posts for that year
/comic/{$year}/{$month}/ -> displays all comic posts for that year/month
/comic/{$year}/{$month}/{$day}/ -> displays all comic posts for that year/month/day
@Frumph
Copy link

Frumph commented Jun 7, 2012

/feed/ -> displays 'post' and 'comic'
/comic/feed/ -> displays just 'comic' post type feed

@Frumph
Copy link

Frumph commented Jun 7, 2012

{$chapter_slug} = hierarchical taxonomy

@Frumph
Copy link

Frumph commented Jun 7, 2012

One of the issues I have is the comic-calendar.php (widget) which is rewritten to handle the post type links back as /year/mo/day/?post_type=comic in that order get_month doesn't return post type

@mikeschinkel
Copy link
Author

Not a URL question, but are chapters nothing more than a name and a slug? Would it be useful to have addition information about them? IOW, would there be any benefit to having them be a custom post type that would be a parent to a comic?

Also, did you know that ?post_type=comic in the URL is the same as $query_var['post_type'] = 'comic' in the 'request' hook (see here: https://gist.github.com/2885558)

@mikeschinkel
Copy link
Author

I don't understand "rewritten to handle the post type links back as /year/mo/day/?post_type=comic in that order get_month doesn't return post type"

@mikeschinkel
Copy link
Author

Why is {$chapter_slug} a hierarchical taxonomy? Can you have chapters within chapters?

@Frumph
Copy link

Frumph commented Jun 7, 2012

Comics navigate by chapters, not by date, as if they were categories.
The relation isn't parent -> child, it's more 'in chapter'

@Frumph
Copy link

Frumph commented Jun 7, 2012

neg, single chapter per comic.

If you look at http://dev.frumph.net/ and the gist for comic-calendar.php the rewritten calendar for month for the post type appends the ?post_type=comic to the end instead of adding it to the beginning of the url because the functions for get_month get_year etc do not associate the post type appropriately.

@Frumph
Copy link

Frumph commented Jun 7, 2012

oh yeah, you can have chapter's within chapter, basically like a story

Book 1
--- Chapter 1
--- Chapter 2 .. 15
Book 2
--- Chapter 1
--- Chapter 2

etc..

@mikeschinkel
Copy link
Author

  • Are there always Books? Can Chapters be in more than one Book?
  • Why are the URLs not /{$book_slug}/{$chapter_slug}/{$post_slug?} (or with taxonomy, I guess they are?)
  • Is $post_slug more appropriately named $comic_slug?
  • What are the exact functions you are using for functions for get_month and get_year and where exactly are you calling them?

@Frumph
Copy link

Frumph commented Jun 7, 2012

  1. There are not always books, some people might not even care to use anything more then a single chapter.
  2. There must always be a chapter, there's doesn't have to be a book. If it does exist, cool.
  3. &comic=post_slug/comic_slug_of_the_post_tiitle, sure.
  4. comic-calendar.php - in the widgets directory, is a rewrite of the get_calendar using the post type comic in it's query.

@mikeschinkel
Copy link
Author

mikeschinkel commented Jun 12, 2012 via email

@Frumph
Copy link

Frumph commented Jun 12, 2012 via email

@Frumph
Copy link

Frumph commented Jul 2, 2012

https://github.com/Frumph/comic-easel/blob/master/comiceasel.php#L369

I got the calendar portion to urlrewrite .. now just looking for a way to make it so that the url line itself can be used and stay that way like http://comiceasel.com/comic/2012/06/29/some-comic-name-slug/ where the url line writes out that way as a pretty permalink

@mikeschinkel
Copy link
Author

mikeschinkel commented Aug 6, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment