Home Forums Add-ons Flexible Content Field plugin shortcode doesn't work in wysiwyg field


plugin shortcode doesn't work in wysiwyg field

  • Hello Sirs,
    thank you for your great work.

    I have a problem with a short code in my flexible wysiwyg field. I need an accordion area and I am using

    Also I am using apply_filters for full wysiswg functions, here is my acf code

    // check if the flexible content field has rows of data
    if( have_rows('inhalt') ): 
         // loop through the rows of data
        while ( have_rows('inhalt') ) : the_row(); ?>
    // Standard
            if( get_row_layout() == 'standard' ): ?>
    		<div class="content-standard">
            $wysiwyg1 = get_sub_field('content-standard', false, false);
    		echo apply_filters('the_content', $wysiwyg1);
    <?php endif; ?>
    <?php endwhile; ?>
    <?php endif; ?>

    The html output looks ok for me

    <div class="content-standard">
    <div id="accordion-2" class="accordion" role="tablist">
    <h3 id="accordion-2-t1" class="accordion-title open read" aria-expanded="true" aria-selected="true" aria-controls="accordion-2-c1" role="tab">Titel 1</h3>
    <div id="accordion-2-c1" class="accordion-content" aria-hidden="false" aria-labelledby="accordion-2-t1" role="tabpanel" style="display: block;">
    Menschen sind keine Maschinen...
    <h3 id="accordion-2-t2" class="accordion-title" aria-expanded="false" aria-selected="false" aria-controls="accordion-2-c2" role="tab">Titel 2</h3>
    <div id="accordion-2-c2" class="accordion-content" aria-hidden="true" aria-labelledby="accordion-2-t2" role="tabpanel" style="display: none;">
    Am Beginn unserer Beratungspraxis steht ein Menschenbild...

    but the accordion script does not work.
    Any idea, can you help me please?
    Thank you

  • Is the accordion script being loaded? does it appear in the html output, it should be somewhere near the bottom before the closing </body> tag.

  • Good morning John,

    thank you for yor support. Yes, the script is loading:

    <script type="text/javascript">
    /* <![CDATA[ */
    var accordionShortcodesSettings = [{"id":"accordion-1","autoClose":true,"openFirst":true,"openAll":false,"clickToClose":false,"scroll":false},{"id":"accordion-2","autoClose":true,"openFirst":true,"openAll":false,"clickToClose":false,"scroll":false}];
    /* ]]> */
    <script src="" type="text/javascript">
    !function(o){"use strict";var t,e;o.fn.accordionShortcodes=function(t){function e(){return o(this).hasClass("open")?h.clickToClose&&i(o(this)):(h.autoClose&&s.each(function(){i(o(this))}),n(o(this),!0)),!1}function n(t,e){,function(){e&&h.scroll&&o("html, body").animate({scrollTop:o(this).prev().offset().top-h.scrollOffset},l)}),t.addClass("open read").attr({"aria-selected":"true","aria-expanded":"true"}).next().attr({"aria-hidden":"false"})}function i(o){,o.removeClass("open"),o.attr({"aria-selected":"false","aria-expanded":"false"}).next().attr({"aria-hidden":"true"})}var s=this.children(".accordion-title"),a=this.children(".accordion-content").hide(),c=s.first(),r=(a.first(),o(window.location.hash)),l=250,h=o.extend({autoClose:!0,openFirst:!1,openAll:!1,clickToClose:!1,scroll:!1},t);return o(".accordion").removeClass("no-js"),h.scrollOffset=0|Math.floor(parseInt(h.scroll)),r.length&&r.hasClass("accordion-title")?n(r,!0):h.openAll?s.each(function(){n(o(this),!1)}):h.openFirst&&n(c,!1),,s.keydown(function(t){var e=t.which;(13===e||32===e)&&o(this).click()}),o(window).on("hashchange",function(){r=o(window.location.hash),r.length&&r.hasClass("accordion-title")&&(h.autoClose&&s.each(function(){i(o(this))}),n(r,!0))}),this};for(var t=0;t<accordionShortcodesSettings.length;t+=1)e=accordionShortcodesSettings[t],o("#"}(jQuery);
    <script type="text/javascript">
    		(function() {
    			var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
    			request = true;
    			b[c] = b[c].replace( rcs, ' ' );
    			b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
  • The HTML output looks correct, the JS code is loading and I don’t see anything wrong with it, although I’m not really familiar with that plugin. The next question is, are you seeing any JavaScript errors for the page?

  • question is solved, it seems that it was a problem of Firefox cache or antivir software.

    Thank you for your help

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘plugin shortcode doesn't work in wysiwyg field’ is closed to new replies.