【问题标题】:WordPress Child Theme: Removes Theme FormattingWordPress子主题:删除主题格式
【发布时间】:2025-12-25 19:45:12
【问题描述】:

使用带有 WP 'Apostrophe' 主题的子主题会导致示例页面在没有任何主题格式的情况下显示:https://begnbark.com/wp/

'希望能在这里得到一些启发。

谢谢!

【问题讨论】:

    标签: php css wordpress


    【解决方案1】:

    您需要将主题的父样式排入队列,将其放在您的functions.php中的子主题中:

    <?php
    
    function enqueue_parent_style() {
      wp_enqueue_style( 'apostrophe-parent', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_style' );
    

    【讨论】: