Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

Lightweight Grid Columns Plugin Strips Tags

Home Forums Support Lightweight Grid Columns Plugin Strips Tags

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #175979
    James

    Hi Tom,

    First of all, *great job* on creating a full-featured theme that doesn’t require 1500 lines of code to produce 3 paragraphs! I have been looking for something like this for a while now, and when I stumbled on to your GP theme, I bought the premium version immediately. Thank you!

    Secondly, I am using your “Lightweight Grid Columns” plugin to recreate my old old layout with about 1000 less lines of code. The problem I’m having is that the TinyMCE editor keeps stripping out my html tags for span, icon, width, height, and iframe so far. It is difficult to achieve the look I want easily without it, yet it is causing me more work trying to work around it by resizing images, editing my functions file and other various ways.

    Is it possible for you to at least make the plugin not revert to the “visual” tab of the editor when saving or updating the pages? I’m not much of a coder, but perhaps you could modify this function to include a bunch of standard HTML tags that the MCE will ignore?

    function override_mce_options($initArray) {
    $opts = '*[*]';
    $initArray['valid_elements'] = $opts;
    $initArray['extended_valid_elements'] = $opts;
    return $initArray;
    }
    add_filter('tiny_mce_before_init', 'override_mce_options');

    Thanks again for your clear and obvious efforts with GP!

    #175997
    Tom
    Lead Developer
    Lead Developer

    Hi James,

    Glad you’re enjoying GP!

    Is it Sections you’re using that is jumping back to the “Visual” tab? This is a limitation of the add-on right now, I’m trying to find a workaround.

    Typically, WP only strips empty HTML elements. So if you put an HTML comment inside the empty elements, WP will leave them alone.

    For example:

    <i class="fa fa-home"><!-- icon --></i>

    Without <!-- whatever -->, WP would strip that icon.

    Let me know if that helps or not 🙂

    #176073
    James

    Thanks for the fast response Tom!
    I noticed that was what you had done on the homepage of this site, but once I added the above code to my functions file and used span tags I was finally able to get the icons to stay.

    It still seemed to need a blank space before the closing icon tag but, my final code looked like this:
    <a class="mybtn blue" href="//jadecomputerservices.com/website-services"><span class="btn-icon"><i class="fa fa-pencil"> </i></span>Learn more</a>

    I also discovered with a little digging that WordPress is stripping out the image dimensions to keep the responsive features working correctly. As you know this started years ago when WordPress devs came up with autop() function, and all my websites were showing validation errors for having closing paragraph tags that were never opened – and after all this time it still doesn’t work right.

    So, if you didn’t code the “columns plugin” to revert to the visual tab automatically on every page save when creating sections, then my bet is on the WP devs for throwing another bad idea into the base code for everyone to enjoy equally.

    #176189
    Tom
    Lead Developer
    Lead Developer

    Hmm, I’ve never heard of image dimensions being stripped by WP – are these images inside the actual editor?

    The main editor should remember if you’re on the Text tab, but the Sections editors don’t remember.

    One option if you don’t like the formatting is to go to “Users > Your Profile” and disable the editor – makes adding your own HTML a lot easier 🙂

    #176284
    James

    Thanks Tom. Yes, it was in the sections editor. I have a few perfectly square images I was adding but instead of resizing the images I was entering width=”300px” height=”300px” for an image that was 400×400 to make it fit the content beside it better.

    The editor would strip out the height altogether, then convert the quotes to &#034 (I think) and possibly the equals sign as well, I can’t remember now.

    In any case, I just resized the images and uploaded them again with a better seo optimized title which was probably a better solution anyway – I was just being lazy I guess. So far I have been able to work around the editor issues so, don’t spend any time on it for my sake.

    There is always this solution for others having troubles, but I haven’t tried it yet:

    http://wordpress.stackexchange.com/questions/17123/keep-html-format-when-switching-from-visual-to-html-editor

    • This reply was modified 4 years, 9 months ago by James.
    • This reply was modified 4 years, 9 months ago by James.
    #176380
    Tom
    Lead Developer
    Lead Developer

    Thanks for that link, could be very useful.

    I’ll continue to improve the Sections editor as time goes on 🙂

    #201792
    Morten

    I am afraid that your method with html-comments inside html does not work. At least for me, the editor strips them out. Very annoying 🙂

    <i class="fa fa-code" aria-hidden="true"><!-- no strip --></i>

    • This reply was modified 4 years, 5 months ago by Tom.
    #201960
    Tom
    Lead Developer
    Lead Developer

    Is this inside lightweight grid columns or just in general?

    #202434
    Morten

    Not sure I understand what you mean. It is inside the columns, i believe.

    I have used short-codes for my font-awesome icons now, and it works fine.

    Since it is only me that is going to work with the site, its OK. But a problem may arise if someone else starts to put tekst into the sections.

    GeneratePress is a great framework, by the way. Very pleased with the ease one can modify the content and the looks of the site.

    #202495
    Tom
    Lead Developer
    Lead Developer

    Glad you’re enjoying it!

    I’ll look into this a little more and see if there’s anything I can do 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.