- This topic has 9 replies, 4 voices, and was last updated 10 years, 1 month ago by
Tom.
-
AuthorPosts
-
February 28, 2016 at 3:51 pm #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!
February 28, 2016 at 10:48 pm #175997Tom
Lead DeveloperLead DeveloperHi 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 🙂
February 29, 2016 at 6:44 am #176073James
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.
February 29, 2016 at 9:48 pm #176189Tom
Lead DeveloperLead DeveloperHmm, 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 🙂
March 1, 2016 at 6:04 am #176284James
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
"(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:
-
This reply was modified 10 years, 5 months ago by
James.
-
This reply was modified 10 years, 5 months ago by
James.
March 1, 2016 at 11:42 am #176380Tom
Lead DeveloperLead DeveloperThanks for that link, could be very useful.
I’ll continue to improve the Sections editor as time goes on 🙂
June 14, 2016 at 1:56 am #201792Morten
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 10 years, 1 month ago by
Tom.
June 14, 2016 at 10:27 am #201960Tom
Lead DeveloperLead DeveloperIs this inside lightweight grid columns or just in general?
June 16, 2016 at 5:46 am #202434Morten
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.
June 16, 2016 at 10:23 am #202495Tom
Lead DeveloperLead DeveloperGlad you’re enjoying it!
I’ll look into this a little more and see if there’s anything I can do 🙂
-
This reply was modified 10 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.