wittyhandle
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Two variants of page next/previous behaviorI’ve figured this out. URL rewrites were the trick:
function wire_alternate_pdp_url()
{
global $wp,$wp_rewrite;
$wp->add_query_var('mode');
add_rewrite_rule('work/all/([^/]*)/([^/]*)/?', 'index.php?post_type=project&name=$matches[2]&mode=all', 'top');}
This rewrites /work/all/identity/my-project to the correct template based on the post_type and name. I also introduce a mode variable that flows through in the rewrite that my single-project.php template can make use of.
Works like a charm 🙂
Forum: Fixing WordPress
In reply to: Two variants of page next/previous behaviorNo thoughts on this? Any ideas in general on how I’d go about alternating the next/previous links within a category or across all categories?
Forum: Fixing WordPress
In reply to: Two variants of page next/previous behaviorLet me re-phrase my question since my first one really wasn’t clear.
I have a custom post type called project. In my single-project.php template I’ll have previous and next links to allow users to navigate to adjacent projects. In the case where the url to a single project is:
/all/works/identity/my-projectthe next/previous links will not consider the category of the project when determining adjacent projects. In the case where the url is:
/works/identity/my-projectthe next/previous links will only allow the user to navigate through projects for the
identitycategory.So my question is this:
How do I configure wordpress to map both URLs to the same project-single.php file?
Thanks!
Forum: Plugins
In reply to: Ideas for a sortable image/video pluginThanks for the reply, the sorting I’m looking for would be done by the author, not the end user of the site. Say a user loads up multiple featured images and/or videos then decides to re-order them simply by dragging one over the other.
So the gallery functionality is pretty close to this:
multiple images
ability to re-arrange their order by drag-n-dropWhat it’s lacking is the ability to include video in a gallery amongst other images.