How to get custom image size for image uploaded in Customizer

Apparently, your mod is storing the complete path to the image as a string. That leaves you little alternative but to do a search and replace on the string: $img = get_theme_mod(‘image-1’); if (!empty ($img)) { $img = preg_replace (‘.(jpg|jpeg|png|gif)$’,’-525×350$0′); if (!file_exists($img)) $img = get_template_directory_uri().’/images/default.jpg’; } else if (!file_exists($img)) $img = get_template_directory_uri().’/images/default.jpg’; In words. Get … Read more

Change display of featured image for pages in twenty seventeen theme

You are struggling with wrong files. You can find post files in theme-folder/template-parts/post/content.php file. You’ll find this code you can add your classes or whatever in your child theme. <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <?php if ( is_sticky() && is_home() ) : echo twentyseventeen_get_svg( array( ‘icon’ => ‘thumb-tack’ ) ); endif; ?> <header … Read more

Writing Clean WooCommerce Styles

What i do is, disable Woocommerce default styles depending on what i want to customize, instead of overwriting the css. Woocommerce loads 3 styles by default: woocommerce-general.css woocommerce-layout.css woocommerce-smallscreen.css If you want to fully customize you can disable all styles or, just the ones that you dont want by adding: // Remove each style one … Read more

Show different Customizer Settings on Page-Tamplates

The customizer API offers active_callback methods on both the control andd section classes. Basically you use either an conditional or a custom function to determine if a control or section is shown to the user. If you want a section to appear only for pages, you would do somthing like this: $wp_customize->add_section( ‘wpse_283821_acme_pages’, array( ‘title’ … Read more