2016-10-13 23 views
0

我正在使用https://wordpress.org/plugins/azurecurve-toggle-showhide/如何在azuretoggleshowhide plugin for wordpress的短代碼中設置我的內容?

當我嘗試在內容中設置任何樣式時,它會被剝離,並且絕對沒有內容樣式。

一個例子

[toggle title_font_size='20px' title='<strong>About</strong>' border='none' disable_image=1] 
<span style='font-style: italic;'>Design is to communicate perception and thought.</span> 


<strong>example</strong> is a multi-disciplinary boutique creative agency 

[/toggle] 

最終代碼會出來爲

<p>Design is to communicate perception and thought.</p> 
<p>example is a multi-disciplinary boutique creative agency</p> 

我如何樣式的內容?

回答

0

我只是看了一下插件代碼。它看起來像是使用$content = do_shortcode($content);來返回您要放入的內容。這會從文本中去除任何HTML。如您所見,它忽略了您使用的<span>並將所有內容轉換爲段落。你在這裏有幾個選擇。

  1. 前往路線azurecurve-肘showhide.php 146在插件文件並刪除$content = do_shortcode($content);。非常哈克,但它很容易,並可能會伎倆。您還需要避免更新插件以防止更改被覆蓋。

  2. 如果您可以放棄加粗的「示例」部分,則可以將短代碼封裝到帶有類的div中,然後使用CSS選擇器來定位第一段。例如:

    .wrapper p:first-child { 
        font-style: italic; 
    } 
    
  3. 建立自己的簡碼或使用不同的插件。 (理想解決方案)