WordPress.org

Ready to get started?Download WordPress

Forums

If else to hide div when meta is not attached to post (2 posts)

  1. mxpimp47
    Member
    Posted 12 months ago #

    I have some code here I came up with from using this Custom Meta Box. I am sure it needs to be cleaned up quite a bit! And I will gladly take what ever suggestions may be given.

    Whats happening is I have a bunch of meta info to display when its attached to a post. When I put the div inside of the if statement it breaks the layout on those posts that shouldn't be displaying the div for the meta. On the pages the meta should display things are fine. How am I supposed to write the php for all the custom meta to display without it breaking the HTML structure?

    Here is the layout - http://pastebin.com/ReEF973M

    The links below, the site layout is not broke, only the (Green) div is still being displayed when it shouldnt on posts with no extra meta. It would break when I would try to move those div elements around in the pastebin link above.

    Here is a link to my test site with meta attached to a post - Link To Test Site With Meta

    Here is a link to my test site with no meta attached to a post, the green box is still visible - Link To Test Site With No Meta

  2. mxpimp47
    Member
    Posted 11 months ago #

    Anyone? I need some wizards help!

Reply

You must log in to post.

About this Topic