What are the ADVANTAGES of ORIGINAL wordpress template structure?

First, as @Toscho implies, the get_header() and get_footer() template tags simply include files named header.php and footer.php, respectively. Both template tags are called from within template files, and you can separate content between template file (index.php) and template part file (header.php, footer.php) any way you want. So, WordPress certainly can accommodate your latter example. That … Read more

How to limit wordpress menu depth in admin panel

Follow up on @jmarceli’s and @squarecandy’s great answers. Here is a solution that allows for: Easier scaling (set an object in the php action) Updates to the correct menu depth when the location checkboxes are changed /** * Limit max menu depth in admin panel */ function limit_admin_menu_depth($hook) { if ($hook != ‘nav-menus.php’) return; wp_register_script(‘limit-admin-menu-depth’, … Read more

How to know if a child theme is being used?

Read the stylesheet. A child stylesheet must have Template: somethemename to function as a child theme. Look in Appearance -> Themes. A child theme should have a notice about requiring a parent theme. Use code similar to this (note: debugging only): add_action( ‘wp_head’, function () { if (get_template_directory() === get_stylesheet_directory()) { echo ‘not a child’; … Read more

Proper use of Output Buffer

No, you don’t need output buffering in this case. As a rule of thumb: Don’t use output buffering unless you really have to. Just imagine what happens if someone else uses output buffering too from a plugin and it crosses with yours: // plugin ob_start(); // later, you in your theme ob_start(); // you call … Read more

How to make native video player full width?

I added this to my style.css and now the video player is fully responsive! .wp-video, video.wp-video-shortcode, .mejs-container, .mejs-overlay.load { width: 100% !important; height: 100% !important; } .mejs-container { padding-top: 56.25%; } .wp-video, video.wp-video-shortcode { max-width: 100% !important; } video.wp-video-shortcode { position: relative; } .mejs-mediaelement { position: absolute; top: 0; right: 0; bottom: 0; left: 0; … Read more