• Resolved wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)


    I run a movie website and I created a custom field called “overall” which when filled out puts a special section at the bottom that details our..you guessed it, Overall thoughts on the film and highlights it.

    Is there anyway to create a page that will pull all the posts that contain that custom field and display it with the post name, and underneath the contents of the “overall thoughts” custom field?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Yes it can be done..

    Easiest way i can see to do this is to use a page template, the page just then acts as a place holder for the posts which have this particular field.

    This is a basic example..

    1. Create a file named thoughts.php or whatever you like and place it in your theme’s folder.
    2. Paste this here into that file, and save..
    3. Now create a page (not a post) from the admin, giving it a suitable title.
    4. Select the thoughts/overall template from the right when creating the page.
    5. Enter some random text into the content (this won’t matter since it’s not going to be shown).
    6. Save, and open up your page..

    Of course you’ll need to tweak the code and add your own HTML etc… πŸ˜‰

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    awesome man!

    where in the code should I change it so that it just shows the post title, and the content from the custom field under that. The way its currently setup it shows the entire post minus the custom field content.

    thanks a bunch!

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    Nevermind! I got it figured out man!

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    One tiny issue, and its probably in my coding, but when there are multiple items with this custom field, wordpress doesnt bunch them up..you can see what i mean here:

    http://itsnotlikethat.com/reviews/

    and here is my code i am using:
    http://wordpress.pastebin.com/m60d031be

    any help would be much appreciated

    Is everything ok now or do you still need some help?

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    still need some help with the above, and now listed below issue:

    “One tiny issue, and its probably in my coding, but when there are multiple items with this custom field, wordpress doesnt bunch them up..you can see what i mean here:

    http://itsnotlikethat.com/reviews/

    and here is my code i am using:
    http://wordpress.pastebin.com/m60d031be

    any help would be much appreciated”

    What exactly is the problem, it’s only the formatting (the CSS and HTML) that looks off on that page, or am i missing something?

    Bunch them up?…

    Can you explain the problem at hand in as much detail as possible and i’ll do what i can to help…

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    sorry..laymans terms. Basically when you go to that page instead of them being together, one post shows inside the main area, and the other posts are showing underneath..its almost like i am missing a statement or something. the 2nd post isnt holding the css styling that I have set for the code that you gave me. its probably something stupid but I cant figure it out..

    You have invalid markup, see here.

    One example…

    <li2

    No such thing as a <li2> element….

    Fix those errors and it may behave as expected.

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    let me check on that..

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    all of the errors saying that they are undefined in the document are defined in my CSS.

    It’s not CSS, it’s HTML…

    You’ll need to go over the theme files and check the code for invalid markup, such as <li2>.

    From looking at the source code i can see some invalid markup is being generated by an ad in the right sidebar…

    There’s more to find though…

    Typically a theme loads the header.php and footer.php with the rest of the files. So check these 2 first, then work from there, single.php , index.php, and so on… until the validation link comes up GREEN and VALID…. πŸ™‚

    If it’s still problematic after all invalidations are corrected i’ll look over your theme files for you.

    If you get stuck, or need to ask questions, please do..

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    I understand what you are saying, but the invalid markup isnt affecting any other parts of the theme. It runs perfectly..i really think that maybe its missing a closing statement or something like that..

    Well i’m happy to offer suggestions, but it’s hard to offer anything of help when you’re running invalid code.

    Browsers are clever in that they can interpret code even when it’s invalid, so the page may behave fine in most cases, though this may vary across browsers, it doesn’t mean you should just leave it be and hope for the best.

    Like i said, fixing the invalid markup may resolve the problem. It may not to, but it’s where i’d suggest to start, and there’s nothing else i’m prepared to offer until the code is validated. “You’d not keep using your car with a flat tire” … it would run in essense… but it makes more sense to fix it first right?..

    Thread Starter wearemoviegeeksdotcom

    (@wearemoviegeeksdotcom)

    i fixed it, i just put the closing statement higher and it worked. weird.

    thanks for your help

    Scott

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Pull Post and Custom Field’ is closed to new replies.