Is there anything like "post pool" for the wp Loop? (7 posts)

  1. janosd
    Posted 7 years ago #

    Hi guys :)

    My first post here. Im newbie in wordpress, kinda post-newbie in PHP :) (i programmed a social networking engine not long ago).

    I have a question.

    I have read the codex but i still dont really understand how the wp loop works.

    How can i give a query to the wp loop? I mean by default it just calls have_posts(), innit? But where is the part which tells the loop to list posts by a certain criteria?

    If i have a complex self written mysql query how can i list that query with the default archive wp loop? Cause i dont want to mess up the code.

    I just want to do

    if (is_category('MySpecialCat')
    give the loop my special query to list
    do the usual.

    I hope its understandable, english isnt my native language and i havea messed-up thinking anyway.

    Thanks for understanding. Cheers.

  2. MichaelH
    Posted 7 years ago #

    Do you mean something like:

       'category__in' => array(2,109,165)
  3. janosd
    Posted 7 years ago #

    yep since then i found the query_posts codex page :-D.

    but for me its not working, at least never the way i want.
    lets say i have got a custom field called "datum" (means date).

    i didnt put dates into it but integers for test first.
    here is what i did:

    if (is_category('Uncategorized'));

    should it work? cause it does not.

    thanks for your attention.

  4. janosd
    Posted 7 years ago #

    ahha! i think i read sg like this before here on the forum:

    the ordering is not working properly. it orders about the half of the posts but every time a value pops in here and there...

    any ideas?

  5. janosd
    Posted 7 years ago #

    okay i found it! the wp meta_value is a longtext type but i try to compare integers. any way to change its type tru query_posts() ?

  6. janosd
    Posted 7 years ago #

    i found a not too pretty workaround but im still interested in how can i define the type of the custom field.

  7. janosd
    Posted 7 years ago #

    ehh sorry, i was talkin bollox, forget it :S.


Topic Closed

This topic has been closed to new replies.

About this Topic