• Resolved allanit

    (@allanit)


    I have a slider on a page. The structure of the slider is

    <div class=”classic-accordion”>
    <div>
    Image
    <div class=”caption”>Caption text</div>
    </div>
    <div>
    Image
    <div class=”caption”>Caption text</div>
    </div>
    and so on until the last </div>

    and it all works until I access the page in wordpress to edit the text below the slider or to do anything else. When I switch from visual to text editor I get the following code

    <div class=”classic-accordion”>
    <div>
    (this is a blank link)
    Image
    <div class=”caption”>Caption text</div>
    </div>
    <div>
    (this is a blank link)
    Image
    <div class=”caption”>Caption text</div>
    </div>
    and so on until the last </div>

    saving the page with the additional blank lines cause the slider not to function properly until the blank lines are removed and the page is re-saved. Any Idea what could be causing it?

    https://www.ads-software.com/extend/plugins/ultimate-tinymce/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Josh

    (@josh401)

    Hmmm… Does the behavior persist if Ultimate Tinymce is deactivated? I’ll continue to help… I just need to know if it’s coming from my plugin or not ??

    Thread Starter allanit

    (@allanit)

    Hi Josh. Good call, yes if I deactivated the Ultimate Tinymce plugin the behaviour still occurs.

    Plugin Author Josh

    (@josh401)

    Okay. Now, does the behavior still occur if ALL of your plugins are deactivated? (Remember, you may have to manually empty your browser cache after deactivating plugins).

    If it still persists with ALL plugins deactivated… then the last step is to switch your theme to the default twentytwelve theme. Once again, manually empty your browser cache and see if the issue persists.

    What we are trying to do is determine if it’s coming from a plugin, your theme, or WP itself. These steps will help us identify the root of the issue.

    Thanks!

    Plugin Author Marventus

    (@marventus)

    Hello Josh and Allanit,
    I hope you don’t mind me jumping in.
    Given the TinyMCE editor’s tendency to strip HTML tags in general, the way I would go about this would be to create a page template with your slider and other code you wish to always include, and then assign that template to the page you are creating in the Admin panel.
    I hope that helps.
    Cheers!

    Thread Starter allanit

    (@allanit)

    @josh
    I manually emptied the browser chase before each change.

    Yes the behaviour still occurs if all plugins are deactivated
    and Yes the behaviour still occurs if I set the theme to the default twentytwelve theme.

    @marventus
    I am always open to suggestions. However I would like to pursue being able to get the editor to function properly first. But if nothing else works I may have to revisit your idea.

    Plugin Author Josh

    (@josh401)

    Yes the behaviour still occurs if all plugins are deactivated
    and Yes the behaviour still occurs if I set the theme to the default twentytwelve theme.

    Okay… if this is truly the case… then it would have to be something with core. Right Marventus? I mean, if you are on TwentyTwelve with no plugins active.. and the behavior persists… then I can’t think of anything else it could be.

    Are you sure you emptied your browser after switching the theme to TwentyTwelve?

    This thread started with this:

    I have a slider on a page. The structure of the slider is

    What is the slider? Is it a plugin? Is it part of your theme? Is it custom code?

    Plugin Author Marventus

    (@marventus)

    Okay… if this is truly the case… then it would have to be something with core. Right Marventus?

    It certainly seems that way to me, although it wouldn’t hurt at all to see the actual HTML output of that page.

    Thread Starter allanit

    (@allanit)

    Hi guys

    I have further tested the behaviour on two other computers and it is replicated on all three, one of witch had never visited the site before so no cashing issues.

    The slider is not a wordpress plugin it is custom code. the slider is Classic Accordion at https://codecanyon.net/item/classic-accordion/140404

    you can see the site where it is here

    https://advancebusinesscollege.wa.edu.au

    I have not ruled out that it is something to do with the slider so am going to ask the author read this thread.

    Plugin Author Marventus

    (@marventus)

    In that case, and given the kind of slider you are using, you have two options:
    1. Create your page in HTML (Text) mode and stick to that mode, which would mean never switching back to visual or, perhaps even, disabling the WYSIWYG editor all together from your USer profile. OR
    2. Create a page template as suggested above and paste the slider code there and only the actual content of your page in the WP page editing screen.
    That’s pretty much what I would do. Now, I’m not saying there aren’t other options (such as, preventing the visual editor from stripping certain HTML tags, etc.), but they don’t add much flexibility in terms of what you seem to want to accomplish.
    If the reason why you want to paste the slider code into the page contents is due to the fact you would like to create multiple sliders, one for each page, you could still create multiple sliders in different html files and call them dynamically through a PHP array and conditional is_page() tags.

    Thread Starter allanit

    (@allanit)

    Hi Guys

    Had the writer of the slider look at this post and my code just in case I had a mistake in it and there is no problem there. He thinks that it is the auto-formatting of the editor. So I guess I will have to leave it with you to track down.

    I would prefer to work in the editor because I configure websites and then hand them over to their owners to manage, and the more that is in the editor the better however I will have a look at the suggestion by Marventus and put it in a template page and see how that goes.

    Plugin Author Marventus

    (@marventus)

    the auto-formatting of the editor

    Yep, that’s what I thought. “autop” is a WP content filter that is applied to posts and pages before HTML output. You could try disabling it from the plugin options, but if you are not very code-savvy, it might be a source of more problems than solutions.

    I would prefer to work in the editor because I configure websites and then hand them over to their owners to manage, and the more that is in the editor the better however I will have a look at the suggestion by Marventus and put it in a template page and see how that goes.

    Ok, I think that’s the best approach, at least with the information you have provided us thus far. However, maybe if you could explain to us why you think it would be best for you to use the editor instead of a template, we could come up with other solutions.

    Plugin Author Josh

    (@josh401)

    @marventus,

    Is there a way we could just tell it to disable wpautop on the slider content? I suppose this would be the plugin developer? Couldn’t he use a remove_filter('whatever_function', 'wpautop')?

    Just thinking out loud here…

    Thread Starter allanit

    (@allanit)

    Hi Josh & Marventus
    The slider is not actually a wordpress plugin it is just code. However I have run some tests and the page template suggestion by Marventus works very well.

    I am mostly thinking of the future edit-ability by the site owner who has zero experience with websites but wants to look after their site on a day to day basis and only get me in if absolutely necessary. The more I can keep in the editor the better because it is one less thing for them to have to learn in a see of new things.

    That said, the slider images and text is not something they are going to change every day, month or even year so putting the code in the template should not cause to many problems.

    I would be interested in any other solutions you guys may have to suggest.

    Thank you both for all of you help so far
    I really appreciate it
    AllanIT

    Plugin Author Marventus

    (@marventus)

    Hello again, Allan.
    Assuming the end goal is for your clients to be able to customize the slider (if needed), there are a few other solutions I can think of (other than the page template approach):

    1. Use a slideshow plugin for WP. There are many out there to choose from and that greatly simplify slider customization for end users.

    2. Turn the slider code into a sort of shortcode (I say a sort because regular WP shortcode approach might not work with undefined parameters, such as the ones you would need), so that your clients could call a slider wherever they wanted by doing this:

    [slideshow slide1="image-url" slide2="another-image-url" slide3="yet-another-url"]

    and it would get replaced by an actual slideshow showing the slides set by your clients in slide1, slide2, and slide3 parameters.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘TinyMCE editor adds a blank line to div’s’ is closed to new replies.