• 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 – https://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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘If else to hide div when meta is not attached to post’ is closed to new replies.