在Wordpress中创建Thickbox

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Wordpress中创建Thickbox相关的知识,希望对你有一定的参考价值。

  1. <?php wp_enqueue_style('thickbox'); ?> <!-- inserting style sheet for Thickbox. -->
  2. <?php wp_enqueue_script('jquery'); ?> <!-- including jquery. -->
  3. <?php wp_enqueue_script('thickbox'); ?> <!-- including Thickbox javascript. -->
  4.  
  5. All these 3 lines of code should insert just before the < ? php wp_head( ) ; ? > function
  6.  
  7. These codes will include necessary files for your Thickbox. So Thickbox is ready for its functioning. Make sure that you have included < ? php wp_head ( ) ; ? > and < ? php wp_footer( ); ? > in your header and footer files respectively.
  8.  
  9. Now we can test it by uploading the image from backend by creating a post. Please note that after the image got uploaded, we need to link the thumbnail image to the original image. And we need to include the class for the anchor tag like this. class=”thickbox”.
  10.  
  11.  
  12.  
  13.  
  14.  
  15. div {
  16. background: rgb(200, 54, 54); /* The Fallback */
  17. background: rgba(200, 54, 54, 0.5);
  18. }

以上是关于在Wordpress中创建Thickbox的主要内容,如果未能解决你的问题,请参考以下文章

在 Wordpress 中创建自定义 URL

在 Wordpress 菜单中创建动态站点地址

如何在 WordPress 中创建唯一用户 ID

PHP 在Wordpress中创建Thickbox

在wordpress中创建空白

在 wordpress 中创建固定标题