Activity Stream
48,167 MEMBERS
62056 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 9 of 9
  1.     
    #1
    Member

    Default PHP help - Need help with putting a list into order

    I have been coding up a little something, but I'm stuck at literally the last hurdle.

    This is part of the code that I have:
    Code: 
    query_posts($query_string . '&cat=203&posts_per_page=20');
    That lists the latest 20 posts from category 203 (which is movies for me).



    But now the part that I'm stuck with.
    I want THAT list above (latest posts), to be in alphabetical order.

    I have tried 'orderby=title', but that lists from the very beginning (posts that I made back in 2010) I don't want that.

    So can anyone tell me the final piece of code that I have to add above in order to do that.
    Thanks
    Ashleyuk1984 Reviewed by Ashleyuk1984 on . PHP help - Need help with putting a list into order I have been coding up a little something, but I'm stuck at literally the last hurdle. This is part of the code that I have: query_posts($query_string . '&cat=203&posts_per_page=20'); That lists the latest 20 posts from category 203 (which is movies for me). http://releasethread.com/uploadedimages/r98voe.png But now the part that I'm stuck with. I want THAT list above (latest posts), to be in alphabetical order. Rating: 5

    UltraIMG - Free Image Hosting
    Want to ask me anything to do with UltraIMG?? Send me a PM.
    Chances are that if you leave a message on the forum I might not see it. :)

  2.   Sponsored Links

  3.     
    #2
    Member
    This site is using a hacked database of W junction
    Last edited by Gavo; 4th Jan 2015 at 02:27 PM.

  4.     
    #3
    Member
    Thanks for the reply Gavo.
    I presume that you are reffering to this:
    PHP Code: 
    '&orderby=title&order=ASC' 
    However it's not exactly that I want.
    This is the result:


    As you can see, although this is in alphabetical order, this is not the same same list that I have above (in my first post).
    This is listing EVERYTHING... however, I just want it to list the latest 20 posts - in alphabetical order.

    Please see the list of posts in my very first picture in my original post.
    I want THAT list of the latest 20 posts in alphabetical order.

    UltraIMG - Free Image Hosting
    Want to ask me anything to do with UltraIMG?? Send me a PM.
    Chances are that if you leave a message on the forum I might not see it. :)

  5.     
    #4
    Member
    Website's:
    vaporhostn.com
    Code: 
    &orderby=rowname (this would be where your getting the title names from)
    Dont know much about this but reading off the page he linked to thats what has to be used

    edit: i see you got it but your going to need to use desc also to get latest posts

  6.     
    #5
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    you tried this?
    Code: 
    &cat=203&posts_per_page=20&orderby=title&order=ASC'

  7.     
    #6
    Member
    Yeah I have, that's what gives me the 2nd image above, which isn't what I want.

    UltraIMG - Free Image Hosting
    Want to ask me anything to do with UltraIMG?? Send me a PM.
    Chances are that if you leave a message on the forum I might not see it. :)

  8.     
    #7
    Member
    Website's:
    epicimagehost.com
    I'll think you'll need to edit the query for that.

    Code: 
    SELECT * FROM tblLulz WHERE fldPrimaryKey > ((SELECT MAX(fldPrimaryKey) FROM tblLulz) - 10) ORDER BY DESC
    I'm not sure you can use custom queries in wordpress.

    edit:

    Or do what gavo said..

    He suggests to put your result in an array, and then sort the array.
    Which works too.

  9.     
    #8
    Member
    Unfortunately I don't know anything about arrays, or how to code them.
    I'm already out of my depth with the current progress that I have made lol

    UltraIMG - Free Image Hosting
    Want to ask me anything to do with UltraIMG?? Send me a PM.
    Chances are that if you leave a message on the forum I might not see it. :)

  10.     
    #9
    Member
    Website's:
    sborg.us
    Can you post a snippet of the code that displays the above list?

    It would be a lot easier to provide you with a solution then

    V3g3ta | Halcyon | Abhi

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. URL is not woking after putting .(dot)
    By GBot in forum Whitehat SEO
    Replies: 0
    Last Post: 19th Dec 2013, 10:50 AM
  2. [Datalife Engine] How to change category list order?
    By Divvy in forum Webmaster Discussion
    Replies: 10
    Last Post: 30th Apr 2011, 11:10 PM
  3. Need help in putting ma HF pass in RL
    By axxo786 in forum Technical Help Desk Support
    Replies: 3
    Last Post: 22nd May 2010, 08:41 AM
  4. Get $100 for Putting a Link in your MSN name!
    By trafficmonster in forum Webmasters, Money Making
    Replies: 152
    Last Post: 21st Nov 2009, 02:11 AM
  5. Putting zshare in an iframe
    By Ruriko in forum Webmaster Discussion
    Replies: 2
    Last Post: 23rd Dec 2008, 11:42 AM

Tags for this Thread

BE SOCIAL