簡體   English   中英

如何阻止 wordpress 主題 css 從 ZA81259CEF8E959C6297DF1D456ED5 站點覆蓋我的自定義 css

[英]How to block wordpress theme css from overwrite my custom css from static site

在 apache2 上的 docker 中運行 wordpress - webroot 是 /var/www/html/

my static site contains./css/style.css and./css/bootstrap.min.css and other./js and./lib in the webroot via index.html

我將 wordpress 放在 /var/www/html/wpress 中,並將 WordPress 地址(URL)和站點地址(URL)指向 http://localhost/wpress

在 wordpress 中,我創建了一個自定義表單,我想將它集成到我的 static 站點中,到目前為止一切正常。

我嘗試通過 iFrame 像<iframe src="http://localhost/wpress/form/" scrolling="yes" style="height:800px;width:100%; display: block; border-style:none; margin: auto; text-align: center;" frameBorder="0"></iframe> <iframe src="http://localhost/wpress/form/" scrolling="yes" style="height:800px;width:100%; display: block; border-style:none; margin: auto; text-align: center;" frameBorder="0"></iframe>但結果給我帶來了雙滾動條等更多問題。

I found https://stackoverflow.com/a/34111610 as the answer with <?php print file_get_contents("http://localhost/wpress/form")?> to work like expected when cp index.html to index.php

問題:現在使用 wordpress 主題。/wpress/wp-content/themes/foobar/assets/css/bootstrap.css 並覆蓋我的配色方案和我的索引中定義的其他自定義。ZE1BFD762321E409CEEZ4AC0B

問題:有沒有像 .htaccess 條目這樣的方法,或者阻止或忽略 wordpress css 覆蓋我的主 ZC7A628CBA2AEA28EB66AZ7?

編輯:我刪除了。 無論如何,這是一種更清潔的方法? 不修改 wp_enqueue_style 或其他?!

您可以在此處取消注冊樣式,傳遞 id,可以在該 css 的查看源中找到

wp_dequeue_style( 'original-enqueue-stylesheet-handle' );
    wp_deregister_style( 'original-register-stylesheet-handle' );

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM