Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End sorting posts by custom fields

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29953
    revok
    Participant

    Hello

    I have recently uploaded a wordpress based homepage.
    My client would very much like to be able to sort posts by way of custom fields.

    Here is the specific page:
    http://www.bisgaardlandskab.dk/ny/projekter

    The custom fields are under each post called "type", "størrelse" (size), "årstal" (year).

    Is there anyway I will be able to do this?

    Thanks
    Simon

    #81356
    revok
    Participant

    thank you

    Well it sort of works. Maybe you can tell me how to make it work as it should.
    What i want is to make a link that makes it possible to sort by e.g “type”

    If I add this:

    Of course I need to add some more code for this, but I can’t seem to find the answer anywhere.

    Thanks
    Simon

    #81345
    jamygolden
    Member

    What do you mean by link? Do you mean a few buttons that sort by letter or type or date, etc?

    #81341
    revok
    Participant

    yes
    links that makes it possible for visitors to filter the posts

    /Simon

    #81339
    Chris Coyier
    Keymaster

    You could write your own PHP for this. Perhaps it links you yoursite.com/?sort=whatever

    Then you $_GET, sanitize it, and use that in your query_posts on that page as the meta key. You could pass any number of variables this way.

    #81322
    revok
    Participant

    Hi Chris.

    Thank you very much. I am sure that this would work.
    I am just a bit unsure about exactly how to do it. My php skills are quite limited…

    Thanks
    Simon

    #81257
    revok
    Participant

    Hello again

    Is there any simple way of describing this to a php noob?

    /Simon

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.