在我的joomla中添加短代码

问题描述:

我想在wordpress中添加php短代码(<?php echo do_shortcode('[shortcode_id="1"]') ?>)。在我的joomla中添加短代码

有没有办法做到这一点?请帮帮我 。

你可以使用DirectPHP这是一个插件,可以直接在Joomla内容页面内嵌入PHP命令!

http://extensions.joomla.org/extension/directphp

+0

谢谢你,你帮了我 – Marina

如果你不想使用您可以使用此代码(为Joomla 3.x的)任何扩展:

$params = new JObject; 
$article = new stdClass; 
$article->text = '------> Write/Assign here the text with shortcodes <-----'; 
JPluginHelper::importPlugin('content'); 
$dispatcher = JEventDispatcher::getInstance(); 
$dispatcher->trigger('onContentPrepare', array('text', &$article, &$params, 0)); 

echo $article->text;