Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Seems as though the visual tab sees a tag with nothing in a gets rid of it to keep things tidy. If you’ve ever seen how some of the older WYSIWYG used to output code you’d see why it works this way. Understanding this though there is a workaround…

    It’s not pretty but it works, any tag that is empty… stick a comment in it!

    So in Dan’s original question code, the workaround would look as follows…

    <div class="mycontent-wrapper">
       <div class="mycontent-top-bar"><!-- Top Bar --></div>
       <div class="mycontent">blah blah blah</div>
       <div class="mycontent-btm-bar"><!-- Bottom Bar --></div>
    </div>

    Hope that’s of help, it works for me.

    Thread Starter atomworks

    (@atomworks)

    OK… seeing as no one seems to know and digging around Google for hours on end didn’t show up anything useful, for anyone that stumbles across this post this is what I did, it may not be relevant to you but if it is I hope it helps.

    It doesn’t seem that I can only call the javascript when the widget is being used on that page so I had to come up with a different approach. My plugin used PHP to place a tag in sidebar like this…

    <div id="gallerywidget"></div>

    The javascript (jQuery based) would then search for the tags and put the relevant HTML in there. Regardless of what page it was or if the tags were there the function would be called and it would retrieve Flickr data and the images but not use them… stupid and pointless overhead for any page not using it.

    Simply what I did to remedy it, and this is not perfect but a lot better then it was, was to wrap the innards of the main function that was being called like this…

    function populategallery(){
         if ( jQuery("#gallerywidget").length > 0 ) {
              // FUNCTION CODE
         }
    }

    This meant when the widget wasn’t being called, the div tags with the ID weren’t being output and so the function effectively would do nothing. It’s a vast improvement as I say and I’ll be happy to release this plugin using this method but I’ll be keeping an eye out for a better way in the future.

    Thread Starter atomworks

    (@atomworks)

    Seeing as this was posted before the weekend when the last thing people would be doing is helping out with coding questions I thought I’d tag this shameless bounce message on in hope someone might see it!

    @justin

    I had this same problem and it turned out to be something to do with the update itself, did an update today and its working perfectly now. None of the other fixes touched it, so I guess it was down to WordPress making a mistake!

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