Title Case WordPress Menu Items

See if the following might work for you, I posted about it yesterday in response to another question so played around with it today. Also see the point in the codex of inheriting from Walker_Nav_Menu instead. You can subsequently modify the output of the menu and use your function. Example from the codex: <?php class … Read more

Changing the default object embed sizes?

This is what I crafted to override the defaults, I set a default media width, choose an aspect ratio (16:9) and then replace the video shortcode output. $defaultMediaWidth = 960; if ( ! isset( $content_width ) ) { $content_width = $defaultMediaWidth; } add_filter( ’embed_defaults’, ‘bigger_embed_size’); function bigger_embed_size() { global $content_width; $width = $content_width; // aspect … Read more

Populate editor with some content of a page with a page template

The is_page_template() function will not work in the admin. The second parameter of the default_content filter is the $post object. Your best bet is to leverage that to get the stored value for the page template in the post meta information: add_filter( ‘default_content’, ‘wpse_editor_default_content’, 10, 2 ); function wpse_editor_default_content( $content, $post ) { if ( … Read more

Theme developement – incative sidebars

Change ‘id’ => ‘sidebar-1’, as your own sidebar name. For example, new sidebar name is sidebar-2 than, our function will – add_action( ‘widgets_init’, ‘theme_slug_widgets_init’ ); function twentyfifteen_widgets_init() { register_sidebar( array( ‘name’ => __( ‘Widget Area’, ‘twentyfifteen’ ), ‘id’ => ‘sidebar-2’, ‘description’ => __( ‘Add widgets here to appear in your sidebar.’, ‘twentyfifteen’ ), ‘before_widget’ => … Read more

Dynamic content in template

This sounds like page caching. Page caching is a good thing, it keeps your site fast. The downside is that any personalized data is not accurate, which is why the clock is not updated. It looks like perhaps WPEngine doesn’t give you control over page caching – https://wpengine.com/blog/no-caching-plugins/ You may need to speak to them … Read more