Gutenberg – editor-font-sizes in functions not working

I believe to get this working I wasn’t calling this at the correct time, and I wrapped it in a function after_setup_theme, like so: add_action( ‘after_setup_theme’, ‘ttp_custom_font_sizes’ ); function ttp_custom_font_sizes() { // removes custom font sizes add_theme_support(‘disable-custom-font-sizes’); // add my own custom sizes add_theme_support( ‘editor-font-sizes’, array( array( ‘name’ => __( ‘Small’), ‘size’ => 12, ‘slug’ … Read more

Disable front-page.php template

Maybe template_include filter would get the job done for you. Something along these lines, function prefix_another_front_page_template( $template ) { if ( is_front_page() ) { $another_front_page_template=”something.php”; // adjust as needed $new_template = locate_template( array( $another_front_page_template ) ); if ( !empty( $new_template ) ) { return $new_template; } } return $template; } add_filter( ‘template_include’, ‘prefix_another_front_page_template’, 99 );

“add_theme_support” for custom footer color?

You can use following class put inside your theme’s functions.php file. Theme Customization API will render the custom color selector control on the Theme customizer from this. class MyTheme_Customize { public static function register ( $wp_customize ) { $wp_customize->add_section( ‘mytheme_options’, array( ‘title’ => __(‘MyTheme Options RR’, ‘twentynineteen’ ), //Visible title of section ‘priority’ => 3, … Read more

I want to get the home root path

First of all your ajax doing approach is wrong when WordPress offer us great way to do this. Read this one why you should’t use your current approach and then read https://codex.wordpress.org/AJAX_in_Plugins how you can do ajax with wp_ajax hook. It’s really simple and easy. using this hook you don’t need to call external file … Read more

custom shortcode will not display the wrapped content

Because the shortcode must return a string. Avoid using the “echo” function in shortcode. Instead of doing that: function my_shortcode_function($content){ echo ‘<div class=”wrap”>’; echo ‘<div class=”col”>’.$content.'</div>’; echo ‘</div>’; } Do that: function my_shortcode_function($content){ $shortcode_return = ‘<div class=”wrap”>’; $shortcode_return .= ‘<div class=”col”>’.$content.'</div>’; $shortcode_return .= ‘</div>’; return $shortcode_return; } Or use object buffering: function my_shortcode_function($content){ ob_start(); ?> … Read more

Child theme style.css versioning

Are you sure the version is included in style.css in the right way? In that case this should really work (hook with wp_enqueue_scripts): $theme_data = wp_get_theme(); wp_register_style(‘your-style-handle’, get_template_directory_uri() . ‘/style.css’, ”, $theme_data[‘version’], ‘all’); wp_enqueue_style(‘your-style-handle’); While developing you may not want to change the file version in style.css all the time, in which case you could … Read more