PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 8, 2022

[FIXED] How do I reorganize wordpress posts by author after they've been queried?

 July 08, 2022     posts, wordpress     No comments   

Issue

I have a page that by default lists posts by chronological order. After the page is loaded, I want the user to be able to click on a button that will sort the posts by author alphabetically, then back to chronologically if desired. Is there a way to do this without sending a new query each time?


Solution

Yes and no,

As long as your blogs are all loaded at once (no pagination) this should be possible with javascript.

However if you are using pagination only the blogs shown on the page you are showing are loaded there for a new query is required each time. This can be done either by a full page reload, or asynchronous using a ajax call.



Answered By - Jasper B
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing