Skip to main content

Forums

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

  • This topic is empty.
Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #91531
    tobeeornot
    Member

    Sorry Doc – I feel a little bad asking you to trawl though my code.



    /*
    Template Name: Home
    */

    ?>





    What We Do













    #91534
    TheDoc
    Moderator

    I’ve never seen multiple queries in a single loop like that. That’s probably what is causing the custom fields to go wonky. Here’s my version of your template:






    What We Do












    Note that I’m resetting the query after each loop.

    Also, I’ve removed the custom fields altogether, since I really don’t see why you want to use them when you can just link directly to the image in your theme’s folder.

    If you need to link to a custom field, don’t combine the template directory code with the custom field code, I’m sure that was causing some issues as well.

    #91535
    tobeeornot
    Member

    Yes, that is really helpful. I thought the loop had to contain all queries but it makes sense that you would break it up and reset it after it each group.

    Regarding custom fields, isn’t the benefit that they can be changed by the user using the WP back-end?

    #91539
    TheDoc
    Moderator

    Totally, but not if they are linking to images in your theme’s folder that they’d have to upload.

    #91541
    OniLinkCR
    Member

    Yeah, it’s best if you post thumbnails if it isn’t already being used or get a multiple post thumbnails plug in. This way they just upload the image and its inserted.

    #91546
    tobeeornot
    Member

    Ok, but to do that would you simply use a class to ensure the images are located in the right position and would that class need to be wrapped in any code?

Viewing 6 posts - 16 through 21 (of 21 total)
  • The forum ‘Other’ is closed to new topics and replies.