• Resolved dewmyster

    (@dewmyster)


    Hi,

    I love this plugin. Its saving my bacon on my wife’s website!

    However, I think I have two issues.

    First, I’m using the openall=”true” option and have a gold-ish colored underline centered in the middle bottom (inside the borders) of each of the accordion items. I double checked the shortcodes and css I’m using and don’t see anything that is an extra space and/or other characters. Any ideas how to turn that off?

    Second, I read the thread about having an un-ordered list within the accordion. Per upfront’s instructions, I put a text box on my page and entered the shortcodes and my HTML between the accordion-item tags. I saw nothing when viewing the page. I took out the unordered list and entered “simpler” HTML: <h1>test</h1>. This time, the HTML wasn’t rendered, but the <h1>test<h1> string was output as plain text.

    I checked the HTML generated with firebug, and this is what was there:

    <div style="display: block;" id="accordion-1-c1" class="accordion-content" role="tabpanel" aria-labelledby="accordion-1-t1" aria-hidden="false"><br>​<h1> testing </h1><br>​​</div>

    It looks like the plugin might be translating as text rather than HTML. Maybe?

    Thanks in advance!!

    https://wordpress.org/plugins/accordion-shortcodes/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    The spacing issues are a common one. By default WordPress adds paragraph and break tags around shortcodes. I usually remove them in the themes I build adding the code below to the themes functions.php file:

    /**
     * Fixes empty <p> and <br> tags showing before and after shortcodes in the
     * output content.
     */
    function pb_the_content_shortcode_fix($content) {
    	$array = array(
    		'<p>['    => '[',
    		']</p>'   => ']',
    		']<br />' => ']',
    		']<br>'   => ']'
    	);
    	return strtr($content, $array);
    }
    add_filter('the_content', 'pb_the_content_shortcode_fix');

    The other issue is a little more difficult. HTML should work inside the content area (between the opening and closing accordion items) if you add it in the “Text (HTML)” tab of the main WordPress editor.

    Is it possible to share a link to the site so I can take a closer look?

    Thread Starter dewmyster

    (@dewmyster)

    Thanks for the quick response. Sorry for my delayed response – I work on this for my wife after my day job.

    I’ve put the site “live” as its still really rough. The URL for the page in question is:

    http://www.clarksburganimalhospital.com/wptest/cahcommunityinvolvement/

    The first set of accordions is just playing around. The second set lower in the page with the UL HTML is what I want to go live with.

    Thanks!!

    Dewey

    Plugin Author philbuchanan

    (@philbuchanan)

    Did you try putting the “code” blocks into the “Text (HTML)” tab of the main WordPress editor? See this image for where the tab should be.

    You can also just use the built in WordPress toolbar buttons to add unordered lists and list items.

    Thread Starter dewmyster

    (@dewmyster)

    I posted about two hours ago, but it didn’t seem to post.

    Anyway, the gist was I’m an idiot. You did mention to try putting the code in the “Text(HTML)” tab of the main WP editor. I tried that tonight and it didn’t work.

    I then re-tried the unordered list via the built-in and then applied the CSS. Not sure why it worked this time, but its working and that’s a great thing.

    Thank you for the responsive help and a life-saver of a plugin.

    Dewey

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HTML not "rendering" in upfront’ is closed to new replies.