Welcome! To use this support forum, please Login or Join Today!

   

RAW tag in layout builder

{name}
Rank

Total Posts: 17

Joined 2012-03-16

PM

 

I’m trying to add some customizations using the ‘Basic Content’ layout in the layout builder. I’m basically trying to use the standard shortcodes (buttons, callouts, adaptive column).

They don’t show unless I use the [RAW] tag. Then then show properly on the page, but so does the ‘RAW’ tag. When I remove the RAW tag the shortcakes disappear.

All this is within the Basic Content page layout.

Also… one for free here? Is there a way to sue the Section layout without an image?

Thanks Casey!

{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

I have the same problem. Is there a solution to fix it?

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

I’ll look into this. Have you tried Settings → Writing → Raw Shortcode : Disabled ?

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

Also… one for free here? Is there a way to use the Section layout without an image?

You can just wrap your content in div.section.

<div class="section">
    your content…
</div>

or:

<div class="section wide">
    your wide content…
</div>

or:

<div class="section wide dark">
    your dark wide content…
</div>
{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

Wordpress: 4.2.2
Lightfast: 1.0.7

Using following Shortcodes doesn’t work well, the RAW-Tag is shown in output:

[raw]
[one_third]content…[/one_third]
[one_third]content…[/one_third]
[one_third last]content…[/one_third]
[clear]
[/raw]

The content inside the div isn’t in one line.

It makes no difference if Raw Shortcode is enabled or disabled.


Attachments:

https://www.filepicker.io/api/file/iyGfZn8SYGZrUxWJL5Db

{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

And I remember that I had had the same problems using the Skelleton-Theme a long time before.

Update 18.06.2015:

Now found out what´s wrong.

In some cases and for no reason has “Settings ? Writing ? Raw Shortcode : Enabled/Disabled” no effect.

I’m not an expert, but there are a lot of threads in the web because of this. I could solve this problem b adding following code to the functions.php:

function my_formatter($content{
       $new_content 
'';
       
$pattern_full '{(\[raw\].*?\[/raw\])}is';
       
$pattern_contents '{\[raw\](.*?)\[/raw\]}is';
       
$pieces preg_split($pattern_full$content, -1PREG_SPLIT_DELIM_CAPTURE);

       foreach (
$pieces as $piece{
               
if (preg_match($pattern_contents$piece$matches)) {
                       $new_content 
.= $matches[1];
               
else {
                       $new_content 
.= wptexturize(wpautop($piece));
               
}
       }

       
return $new_content;

remove_filter(‘the_content’, ‘wpautop’);
remove_filter(‘the_content’, ‘wptexturize’);

add_filter(‘the_content’, ‘my_formatter’, 99);

Source: https://css-tricks.com/snippets/wordpress/disable-automatic-formatting-using-a-shortcode/

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

This has honestly been plaguing me for years. Sometimes a third party plugin will add wpautop add a higher priority when the shortcode has nicely asked not be be wpautop’d.


The solution is to add this to your child theme:

remove_filter'the_content''wpautop' );
add_filter'the_content''wpautop' 99);
add_filter'the_content''shortcode_unautop',100 ); 
{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

Have a look ahead…

{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

Okay, I tried your Bugfix. It is working fine. Only one thing to say: My “Bugfix” ahead prevent the auto-formatting from wordpress. It makes you able to use plain HTML without having wordpress creating bullshit.

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

I hear you. Are you saying this issue is resolved?
On my personal sites, I just disable wpautop and the visual editor altogether. But most users want it the other way.

{name}
Rank

Total Posts: 9

Joined 2014-12-12

PM

 

The Problem is solved - but it depends.

I create the most content and structure by hand using the default-template. Therefore it’s better for me to use the modify i’ve posted above, so I am able write abosulte plain HTML without bullshit interaction from wordpress. But you’re right. If someone is using the insite-editing, he should use your bugfix.

So, it’s well done ; )