-
Notifications
You must be signed in to change notification settings - Fork 170
add next and previous buttons to learn pages #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Because menu_order is a single sequence, this is going to be much less performant as it needs to pull the details for all pages at once. So it probably makes sense to go with the original approach I pondered. So I'm thinking two queries for Note that I think the |
Should work:
If so, I'll add it to a new shims plugin. |
Thanks @nacin. This works fine for me. I have currently committed it into the local functions.php in the learn template, but once it is a plugin, I can remove that. |
What's the good word here? Seems like this won't merge cleanly as of now.... Would like to be able to close jquery/learn.jquery.com#31 |
Sorry, I didn't realize that this didn't merge cleanly anymore. I just merged with upstream/master and resolved the conflicts, but I don't know if that was the right way to handle this. Should I be making a new PR? |
It appears that it can be automatically merged, but perhaps another pull without so many unrelated commits might be helpful at this point. I'll leave this up to @scottgonzalez @jzaefferer |
Don't listen to GitHub when it comes to mergability, also don't use the Green Button™. In this case, the merge looks rather messy, so let's properly rebase this and squash fixup commits (including the merge commit). Usually an interactive rebase is the easiest way to do that: |
@jzaefferer I interactively rebased and it looks like it should be a clean merge with only two commits. Let me know if this works. |
@jzaefferer This should be fixed now and I squashed it to one commit. |
Nice. Found one more issue: The index page also get's these buttons, but just links to itself, twice. |
* This is the template that displays all pages by default. | ||
* Please note that this is the WordPress construct of pages | ||
* and that other 'pages' on your WordPress site will use a | ||
* different template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really belong here, does it? I mean this entire file inside this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, sorry about that. I should have paid more attention.
@jzaefferer What do you mean by the index page? When I go to Is this not what I should see? I just |
😮 Hmm, I have to figure that out then. Maybe something is wrong with my wordpress instance. |
@buritica and I are working on the index page right now. we just updated web-base-template last night to have the static index page plugin last night in 343f544, and will be pushing an index page shortly. i was experiencing the same issue as @johnkpaul with the main index not showing until we added the plugin. |
This was due to a bad choice in grunt-jquery-content that I made in assigning posts draft status if they weren't in order.yml. The index page will be display normally if you pull learn.jquery.com master, npm install, and probably truncate your wp_5_posts and wp_5_postmeta tables. That said, the index page is going to need its own template, but that's a separate issue |
Thanks @ajpiano. After following those instructions, I do see the index page. I can add something to the page.php template to hide this, specifically for the index page. But if it is going to be a new template anyway, I don't know if I need to worry about it. I don't see any other pages that shouldn't have this. /cc @jzaefferer |
I would say not to worry about it, the index page is going to have its own template (cc @buritica) |
Yes, Its going to be a different template. I'm pushing that out today. |
Alright, landed! |
This adds next and previous links to the content pages of learn.jquery.com. @nacin, I'd love some code review on my query in functions.php. It is no longer scoped to the parent id, because the menu_order is a single sequence across all parents.