Skip to main content

wordpress help of the day 55 Responses

Last post: 2 years, 10 months ago | Thread started: Aug 23, 10, 8:03 a.m.

RespondNew TopicDisable Images

  • hans_glib

    I rather rashly (as it turns out) agreed to help my daughter put her blog together... I thought it would be quite straightforward - find a WP theme and feck about with the CSS.

    But no.

    She wants the home page to have three columns - with each column for a different post category/subject - see below:

    http://www.thenewcow.com/qoobeenn/layout.gif

    Digging around on teh interweb I found a tut (http://www.cre8d-design.com/200... that says this requires multiple loops. I can just about get my head around this but now I have fallen into a spiked pit of php (the codex page on multiple loops...) and I have no idea what the feck I am doing...

    The code I have put together can be seen here:

    http://www.thenewcow.com/qoobeen…

    Are any of you php Heroes out there able to have a quick look and tell me if this reads ok?

    Ta ever so

    Aug 23, 10, 8:03 a.m. – Permalink
  • acescence

    you can't use query_posts multiple times on the same page. query_posts is for modifying the main loop on a page with new parameters. for the second and third loops, you have to create new queries...

    $my_second_query = new WP_Query( 'category_name=music&posts_per_p... );
    while ($my_second_query->have_posts()) : $my_second_query->the_post();
    // loop stuff
    endwhile; endif;

    $my_third_query = new WP_Query( 'category_name=live&posts_per_pa... );
    while ($my_third_query->have_posts()) : $my_third_query->the_post();
    // loop stuff
    endwhile; endif;

    • i have no idea what any of that means but thanks very much - i'll give it a gohans_glib
    + add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 23, 10, 8:46 a.m. – Permalink
  • FallowDeer

    im no wordpress master but I managed to get different loops working on this site http://www.ladybehave.com/blog/ using post query

    But I think it is better using the above method

    • it's possible in some cases, but some global variables don't get reset and plugins that rely on the loop will breakacescence1/2
      Yea I wouldnt use my method if I was releasing a downloadable theme no wayFallowDeer2/2
    next note >+ add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 23, 10, 8:52 a.m. – Permalink
  • hans_glib

    OK that all works really well, thanks acescence.

    got another one for you... how to make WP generate a thumbnail of an image used in a post, and add it to the excerpt on the home page. I tried the "Thumbnails For Excerpts" plugin but can't seem to get it to respond properly. Any other ideas? Currently I'm on the prowl for a theme that might have this functionality built in, but any help would be much appreciated.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 24, 10, 12:33 a.m. – Permalink
  • kodap

    You will need to add few lines of code in the file "functions.php" , and then call that function where //loop stuff is.
    I'll give you an example:

    http://kodap.com/qbn/example_thu…

    • this function will use the first thumbnail sized image you have uploaded to your post's gallery - it's automatickodap1/2
      brilliant! thanks so muchhans_glib2/2
    next note >+ add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 24, 10, 3:56 a.m. – Permalink
  • meffid

    It would be faster to custom build this whole site than use wordpress.

    • you're telling me. but i don't have the capabilities or cashhans_glib1/6
      and at least i'm learning a lot about wordpress...hans_glib2/6
      faster to custom build a whole admin back end? that's ridiculous. maybe just a static page, but that's pretty useless for his purposes.acescence3/6
      i meant it would be faster for someone clever to build it from scratch than me struggle with WPhans_glib4/6
      but thanks to you and kodap it's looking and working ok so farhans_glib5/6
      hey, give yourself some credit man! I think you've still got a head start, you can do it!acescence6/6
    next note >+ add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 24, 10, 9:22 a.m. – Permalink

Login or Register to respond to this

Skip to main content