P文本添加到HTML文本 [英] P text added to html text
问题描述
我知道有很多这方面的话题,而且我已经看过所有的话题,而且没有任何解决方案适用于我。
我把一个短代码运行在我的页面编辑器的文本一侧的响应滑块jscript。然而当我加载页面时,源代码在javascript的每一行之后都有很多段落标签。它甚至还有一个段落标签,甚至要求内容本身。
我试过编辑我的主题(Reason 2.0)的functions.php文件,但我不确定我能否正确地标记它,这是非常php的 - 重。我也尝试了这里提到的五个插件。他们没有任何影响。
代码很可怕,看起来像这样:
< ; p为H. <! - START REVOLUTION SLIDER - >< / p>
< div id =rev_slider_1_1_wrapperclass =rev_slider_wrapperstyle =margin:0px auto; background-color:#E9E9E9; padding:0px; margin-top:0px; margin-bottom:0px;> ;
< div id =rev_slider_1_1class =rev_sliderstyle =display:none;>
< ul>
< li data-transition =slidehorizontaldata-slotamount =5data-masterspeed =300data-link =http://www.secondhandculture.org/mad-men-and-attraction >
< div class =caption sft< br />
data-x =&#8221; 400&#8243;< br />
data-y =&#8221; 20&#8243;< br />
data-speed =&#8221; 300&#8243;< br />
data-start =&#8221; 200&#8243;< br />
data-easing =&#8221; easeOutExpo&#8221;>< img src =http://www.secondhandculture.org/wp-content/uploads/2012/12/Mad-men- text.pngalt =Mad Men>< / div>
< div class =caption big_white sfr< br />
data-x =&#8221; 550&#8243;< br />
data-y =&#8221; 140&#8243;< br />
data-speed =&#8221; 300&#8243;< br />
data-start =&#8221; 500&#8243;< br />
data-easing =&#8221; easeOutExpo&#8221;>如何让我们爱上< br />
我们知道我们应该讨厌的是,< br />
并询问我们为什么< / div>
< / li>
< / ul>
< div class =tp-bannertimer tp-bottom>< / div>
< / p>
< / div>
< / div>
< p> < script type =text / javascript>< / p>
< p> var tpj = jQuery;< / p>
< p> tpj.noConflict();< / p为H.
< p> if(tpj.fn.cssOriginal!= undefined)
tpj.fn.css = tpj.fn.cssOriginal(tpj.fn.cssOriginal!= undefined)
(document).ready(function(){< ($#
$ b $ lt; p $ gt;
$延迟:9000,
startwidth: ,
startheight:300,
hideThumbs:200,< / p>
< p> thumbWidth:100,
thumbHeight:50,
thumbAmount:1, < / p>
< p> navigationType:none,
navigationArrows:nexttobullets,
navigationStyle:round,< / p>
<
onHoverStop:on,< / p>
< p> navOffsetHorizontal:0,
navOffsetVertical: 20,< / p为H.
< p> shadow:2,
fullWidth:off,< / p>
< p> stopLoop:off,
stopAfterLoops:-1,
stopAtSlide:-1,< / p>
< p> shuffle:off
});< / p>
< p> }); //准备< / p为H.
< p> < /脚本>< / p为H.
< p> <! - END REVOLUTION SLIDER - >< / p>
$ c> add_filter('the_content','wpautop')不适用于我的主题。所以我做了以下工作:
-
在 revo滑块 admin区域中,选择滑块显示不好。
li> -
Jquery No Conflict Mode = ON
-
(重要部分)输出过滤器保护= 通过压缩输出
这样,脚本将只在一行,因此auto段过滤器只会将p标签添加到一行中。
I know there are a lot of topics on this, and I've already looked at all them and none of the solutions there apply to me.
I've put a shortcode to run a jscript for a responsive slider in the 'text' side of my page editor. Yet when I load the page, the source code has tons of paragraph tags after every line of the javascript. It even has a paragraph tag before it even asks for the content itself.
I've tried editing the functions.php file of my theme (Reason 2.0), but I'm not sure I could mark it up correctly, it's very php-heavy. I've also tried five of the plugins suggested here. None of them have any effect.
The code is horrendous, and looks like this:
<p> <!-- START REVOLUTION SLIDER --></p> <div id="rev_slider_1_1_wrapper" class="rev_slider_wrapper" style="margin:0px auto;background-color:#E9E9E9;padding:0px;margin-top:0px;margin-bottom:0px;"> <div id="rev_slider_1_1" class="rev_slider" style="display:none;"> <ul> <li data-transition="slidehorizontal" data-slotamount="5" data-masterspeed="300" data-link="http://www.secondhandculture.org/mad-men-and-attraction" > <img src="http://www.secondhandculture.org/wp-admin/admin-ajax.php?action=revslider_show_image&img=uploads%2F2012%2F12%2Fmad-men-image.jpg&h=300&t=exact" ></p> <div class="caption sft"<br /> data-x=”400″<br /> data-y=”20″<br /> data-speed=”300″<br /> data-start=”200″<br /> data-easing=”easeOutExpo”><img src="http://www.secondhandculture.org/wp-content/uploads/2012/12/Mad-men-text.png" alt="Mad Men"></div> <div class="caption big_white sfr"<br /> data-x=”550″<br /> data-y=”140″<br /> data-speed=”300″<br /> data-start=”500″<br /> data-easing=”easeOutExpo”>How it makes us love <br><br /> what we know we should hate, <br><br /> and asks us why</div> </li> </ul> <div class="tp-bannertimer tp-bottom"></div> </p> </div> </div> <p> <script type="text/javascript"></p> <p> var tpj=jQuery;</p> <p> tpj.noConflict();</p> <p> tpj(document).ready(function() {</p> <p> if (tpj.fn.cssOriginal != undefined) tpj.fn.css = tpj.fn.cssOriginal;</p> <p> var revapi1 = tpj('#rev_slider_1_1').show().revolution( { delay:9000, startwidth:, startheight:300, hideThumbs:200,</p> <p> thumbWidth:100, thumbHeight:50, thumbAmount:1,</p> <p> navigationType:"none", navigationArrows:"nexttobullets", navigationStyle:"round",</p> <p> touchenabled:"on", onHoverStop:"on",</p> <p> navOffsetHorizontal:0, navOffsetVertical:20,</p> <p> shadow:2, fullWidth:"off",</p> <p> stopLoop:"off", stopAfterLoops:-1, stopAtSlide:-1,</p> <p> shuffle:"off" });</p> <p> }); //ready</p> <p> </script></p> <p> <!-- END REVOLUTION SLIDER --></p>
解决方案I had the same problem once, and
add_filter( 'the_content', 'wpautop')
does not work on my theme. So what I did was the following:In the revo slider admin area, select the slider that is not displaying well.
Look for the troubleshooting tab (Bottom right) then change the values
Jquery No Conflict Mode = ON
Put JS Includes To Body = FALSE
(Important part) Output Filters Protection = By Compressing Output
That way, the script will be just in one line therefore the auto paragraph filter will just add the p tag to a single line
这篇关于P文本添加到HTML文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!