• michaelw90

    (@michaelw90)


    Hello dear WordPress Forum πŸ™‚

    I’m embarked in a personal web project of mine and I’m having some troubles seeing I’m not that good of a programmer.

    I was planning on using Gravity Forms to let users post “projects”. Meaning they fill out a form that’s on my site and that form gets posted as a custom post type in a feed. I tried doing this using these plugins:
    – Types and Views
    – Gravity Forms
    – Gravity Forms Custom Post Types
    – SF Pages For Custom Posts (this last one sorts the Custom Post Types and feed it like blogposts)

    My problem is that what I want to show doesn’t show. I only get information from the “Post Fields”. But I also have Price Fields, date, and additional information that won’t show.

    I’ve made a rough mockup of how I would like them to look and what information I would like them to show

    The pictures would map to what the users choose from a dropdown in GF. This dropdown has five different options that portray what kind of job the client is offering. The picture will then change according to which options he/she chooses. The name already shows, and so does the description.
    What doesn’t show however is:
    – The picture (obviously)
    – The timer/date
    – The extras (these are checklist items that would add to the total price)
    – “Take Job” Button

    So my problem is that I don’t know how to deal with this in a proper way. Going around with plugins seems too uncertain for me, so I would appreciate any kind of help on this matter πŸ™‚

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You will want to hook the filter ‘the_content’. Your function will be passed all the html for a post. Query the database for your custom fields, format it as html, and insert into the html you were passed. Return the whole altered html string and it will show up for each post.

    So you now have all the data showing for each post, getting it looking right is a CSS issue.

    Thread Starter michaelw90

    (@michaelw90)

    bcworkz, thank you for your reply πŸ™‚

    I almost understood it, hehe. I mean, I’ve been reading quite a bit about this, the main problem is that I have little to none experience in PHP.

    Ok so, I hook the filter ‘the_content’. Where do I hook it? in my template file or in my functions file? …neither? Querying the database i probably could manage. I’ve been looking at a few tutorials that brings that up.

    Would I need to make individual files for single and archives as well?

    CSS is not a huge problem, thankfully πŸ˜‰

    Thanks again for the reply!
    Michael

    Moderator bcworkz

    (@bcworkz)

    Add your hook to the functions file.

    As long as your templates are using the template tag the_content() or a different tag that calls it, you needn’t do anything else.

    This will be a nice little project to develop your PHP skills. I’ve always found these sort of things turn out easier than they initially appeared. Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Post Types with Custom Fields into feed/loop’ is closed to new replies.