-
AuthorPosts
-
October 17, 2018 at 7:49 pm #1022986
I have added a Code Block on the homepage here immediately under the “Welcome to the Henley Herald…” headline in the main text, right above the company logos. It is set to ‘Add codeblock to content’
Please look at the live code using Developer Tools and you will see HTML code:
<section class="avia_codeblock_section avia_code_block_0" etc etc
so the Code Block is being added.
Next HTML line is:
<div class="avia_codeblock " itemprop="text"> </div>
but the shortcode, added to the Code Block element,
[the_ad id="13590"]
has been stripped out by ALB.As a test, if I ‘Escape HTML Code’ then the shortcode is displayed on screen as a line of text – [the_ad id=”13590″] – as you would expect.
Why is the shortcode being stripped out? And how do I stop this happening?
October 18, 2018 at 8:39 am #1023191Hey zimbo,
I’m not sure, it might because of the double quotes. Please try this instead:
[the_ad id='13590']
Best regards,
RikardOctober 18, 2018 at 12:49 pm #1023323Hi,
Still doesn’t work with single quotes. I also removed any quotes, i.e. [the_ad id=13590], and it all still gets stripped out.
(NB. The shortcode inserts an ‘ad’, in this case a company logo. Shortcodes work on posts. I’ve added the shortcode as the first line of text under the main photo on this post, http://dev.henleyherald.com/2017/07/06/lorries-causing-more-problems-on-henley-bridge/, and you can see the image/ad inserted. So I think this problem is to do with ALB.)
I tried a few things. There’s a PHP version to insert the ad. I don’t think Code Block supports PHP but I wanted to see the outcome.
Code block altered to
<?php the_ad(13590); ?>
renders as HTML:<div class="avia_codeblock " itemprop="text"> <!--?php the_ad(13590); ?--> </div>
and no image/ad displayed.
If I revert to the shortcode and change the square brackets to round e.g. (the_ad id=”13590″), then that is displayed as text on screen.
HTML:<div class="avia_codeblock " itemprop="text"> (the_ad id="13590") </div>
Given the shortcode is being stripped out whether with single, double or no quotes on square brackets, but is not stripped out with round brackets, whichever code module processes Code Block is finding the square bracket and stripping out everything between the open and closing square brackets.
Can you stop this happening?
October 20, 2018 at 2:16 am #1024254Hi,
I took a look at your page and see where the shortcode should have been, I also tried the shortcode in my localhost, and the shortcode was not stripped out. I then tried other shortcodes, that were installed on my localhost, and they worked correctly
Have you tried disabling your plugins? If that resolves the issue, reactivate each one individually until you find the cause.
Also, do you have any custom javascript installed in your functions.php, please try removing it temporary to see if that is causing a conflict.If this doesn’t help, please include a admin login in the private content area so we can take a closer look.
Best regards,
MikeOctober 22, 2018 at 6:40 pm #1025046I found the problem and all is working now.
Thanks for your suggestions, they helped me track down the issue (and it wasn’t ALB). Please close this.
October 22, 2018 at 9:08 pm #1025113Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Plugin shortcode being stripped by ALB’ is closed to new replies.