Advertisement
Guest User

Untitled

a guest
Dec 15th, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. //Custom lines in Functions.php
  2.  
  3. add_filter('stylesheet', function ($stylesheet) {
  4.     return dirname($stylesheet);
  5. });
  6.  
  7. add_action('after_switch_theme', function () {
  8.     $stylesheet = get_option('stylesheet');
  9.     if (basename($stylesheet) !== 'templates') {
  10.         update_option('stylesheet', $stylesheet . '/templates');
  11.     }
  12. });
  13.  
  14. add_action('customize_render_section', function ($section) {
  15.     if ($section->type === 'themes') {
  16.         $section->title = wp_get_theme(basename(__DIR__))->display('Name');
  17.     }
  18. }, 10, 2);
  19.  
  20. //Custom lines in index.php in root-folder
  21.  
  22. if (defined('ABSPATH')) {
  23.     update_option('template', get_option('template') . '/templates');
  24. }
  25.  
  26. die();
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement