- This topic has 1 reply, 1 voice, and was last updated 8 years, 10 months ago by .
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I would like to have an AJAX powered front page on my site that allows users to select a category (or custom taxonomy) and then see the posts (or in my case custom teasers from my own replacement loop) update without a page reload.
There is a useful more general WordPress tutorial here.
Google seems to highlight some examples of people discussing this in Genesis and it seems all rather doable to me, however no one has posted up a good "how to" as far as I can see.
Does anyone know if anyone has covered this before using Genesis? Blog post, or here in the forum?
If not, I will do my best to work it out and will gladly share the results.
My main concern is the overall architecture. I already have a custom Genesis loop which I have implemented via a plugin (as I use different child themes a plugin makes management easier). So I guess I need my Ajax script to replace the content area of my homepage with a re-load of my loop filtered for the category. Trying to figure out a nice way to do it all via a plugin.
I have also tried this plugin which didn't seem to work for me, I'm guessing a Genesis compatibility issue? But to be honest I kinda wanna build something myself for the experience / challenge of it. But it is pretty much what I want to do!
I figured it out.
If anyone else is interested, my solution was to create a custom loop based on the posts here - lots of help in the comments.
My loop was a function in my own plugin's class. I used jQuery AJAX to post back to a "handler.php" script, this interpreted the $_POST variable and passed these parameters to my custom loop function in the class (which I made global). The loop outputs a set of posts that replaces the current set on the page.
All working very smoothly, thanks all. I'll post up a more detailed explanation here at some point in the (distant) future.
© 2022 WPEngine, Inc.