How to make thumbnail image fit into a div where image dimentions are completely different?

It may be that some of your images were uploaded before you created the custom image size function. If that’s the case, a plugin like Force Regenerate Thumbnails will solve your problem. Alternatively, for more versatility you could use the images as backgrounds, like so: <div style=”background-image: url(<?php the_post_thumbnail_url(); ?>)” id=”post-thumbnail”></div> and set the background … Read more

How to hook CSS file according to theme selection in the customizer section

You can access Customizer values with get_theme_mod(), so you just need to check the value of your setting before enqueueing stylesheets the normal way: function wpse_310123_enqueue_scheme_css() { $scheme = get_theme_mod( ‘theme_scheme’ ); if ( $scheme === ‘green’ ) { wp_enqueue_style( ‘theme-green’, get_theme_file_uri( ‘green.css’ ) ); } elseif ( $scheme === ‘blue’) { wp_enqueue_style( ‘theme-blue’, get_theme_file_uri( … Read more

wordpress custom theme import and export options for sample data [closed]

You don’t have to export and import the tables from the database; you don’t have to build an export/import function for your theme either. There is an Export tool built in WordPress under the Tools menu and in the same sub-menu you’ll find the Import tool as well. The process is pretty straightforward: export the … Read more