Winning Agent

Sales That Work

  • About
  • Store
  • Blog
  • The Stream
  • Forum
  • Jobs

Community Page/Archive Sort Order

Home › Forums › Winning Agent Pro Theme › Community Page/Archive Sort Order

Tagged: community CPT, sort order, wp-query

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 7 months ago by Ginger Coolidge.
Viewing 1 reply thread
  • Author
    Posts
    • November 11, 2014 at 3:02 pm #3907
      Winning Agent Staff
      Keymaster

      If anyone needs to control the order of items appearing on the Community page (default is descending by post id => Last published, Shown first) there is a plugin called Simple Custom Post Order.

      You can choose what the plugin targets (I did community post types only). Then go to the Community Section in WordPress back end and drag and drop into order you would like.

      Just curious if there is a way to do this in code verses using a plugin?


    • November 13, 2014 at 4:19 pm #3935
      Ginger Coolidge
      Participant

      Hi there,

      Yes, you can do this. You’ll be adding whats called an action to your functions.php file. This article by Bill Erickson gives a few examples on how to change it.

      Customizing the WordPress Query with pre_get_posts

      I haven’t actually done one so I don’t have code to share, but you’ll be targeting the wap-community post_type and changing the ORDER BY portion of the query.

      Also this page from the codex talks about WP_Query sort options:
      http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

      Another useful plugin is called Query Monitor where you can see exactly what queries are called when you access the Community archive page (or any other page).

      Here is the link for that plugin:

      Query Monitor

      And finally, you can always check out the code in the Simple Custom Post Order plugin — it might help you with the syntax on how to construct your query. Reverse engineering is a great way to learn all this stuff!

      Regards,

      Ginger


  • Author
    Posts
Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Log In

Forum Login

Log In
Register Lost Password

Search Forums

StudioPress Real Estate WordPress Theme: Agent Focused Pro Theme
StudioPress Premium WordPress Themes: Winning Agent Pro Theme

Recent Replies

  • How to edit main page background image opacity
  • Fresh Install Issues
  • Remove Background Image
  • Sidebar on Homepage
  • Featured Page on Homepage Not Clickable
OptinMonster

Loan Types & Property Definitions

There are a lot of different types of mortgages, and there are a lot of different types of real estate property. Here is a list of the most common types of each. We’ve added some links to the most popular articles on the subject.

Read More

Real Estate and Mortgage Forum

We think getting many viewpoints to a particular question is important because it helps you to make better decisions. It’s so important that we have woven the Forum all throughout Winning Agent. We invite you to ask questions, make comments, and be part of the discussion.

Read More

Glossary of Real Estate Terms

Real estate and mortgage finance often times comes with its own unique language. If you work with it every day, it becomes 2nd nature, but most people don’t work with it every day. So we’ve created a glossary of mortgage and real estate terms.

Read More

Copyright © 2022 Winning Agent · Powered by the Genesis Framework · Contact Us
Become an Affiliate
This site uses affiliate links, but know that we only recommend products we personally use and enjoy!