我在WordPress中创建了一个2语言站点,我需要说:
如果html方向是RTL使用一些代码,否则使用另一个代码...
我用我在Joomla中使用的传统方式尝试过这个
<?php if( $this->direction=="rtl"){ ?>
/images/slider/01.jpg " alt="滑块01 " title=" #htmlcaption " /> /images/slider/02.jpg" alt = "Slider 02" title = "#htmlcaption" /> /images/slider/03.jpg " alt=" Slider 03 " title=" #htmlcaption " /> /images/slider/04.jpg" alt = "Slider 04" title = "#htmlcaption" /> هذا مثاللما يمكنانيكتبهنا . /images/slider/01.jpg " alt=" Slider 01 " title=" #htmlcaption " /> /images/slider/02.jpg" alt = "Slider 02" title = "#htmlcaption" /> /images/slider/03.jpg " alt=" Slider 03 " title=" #htmlcaption " /> /images/slider/04.jpg" alt = "Slider 04" title = "#htmlcaption" />提供成本效益AND RELIABLE MARINE TRANSPORTATION This 是带有链接的HTML Headers 的示例 . This 是带有链接的HTML Headers 的示例 . This 是带有链接的HTML Headers 的示例 .
但它总是说有一个致命的错误..我想我需要将 $this
定义为html页面,但如何在PHP中说这个?
:在第7行的C:\ AppServ \ www \ wordpress \ wp-content \ themes \ wp \ index.php中不在对象上下文中时使用$ this
2 回答
它似乎是我们构建到另一个名为“language_attributes()”的函数中 . 试试这个:
基于以下信息:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/general-template.php#L0
http://wpml.org/2011/06/creating-right-to-left-rtl-wordpress-sites/
http://codex.wordpress.org/Right-to-Left_Language_Support
试试这个: