WordPress Theme: replace logo image with title site if file doesn´t exist on server

Solved with: <?php if (file_exists(get_template_directory().’/images/logos/’.$server_name = preg_replace(‘/[wW]{3,3}\.|\.(es|com|net)/’, ”,$_SERVER[‘HTTP_HOST’]).’.png’)) { ?> <a href=”https://wordpress.stackexchange.com/questions/149864/<?php echo home_url(“https://wordpress.stackexchange.com/” ); ?>”><img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/logos/<?php echo $server_name = preg_replace(‘/[wW]{3,3}\.|\.(es|com|net)/’, ”,$_SERVER[‘HTTP_HOST’]).’.png’ ?>” border=”0″ width=”230px” height=”60px” alt=”<?php bloginfo( ‘name’ ); ?>”/></a> <?php }else{ ?> <h3><?php bloginfo( ‘name’ ); ?></h3> <?php } ?> Thanks at all!

Search doesn’t display posts with images

What you’ve provided is the displayed code on the website. You’ll need to edit the single.php and make it match the archive/index page of your theme. search the index the code you want, place it in your post single.php. Good luck and let me know if you have other questions.

Set custom banner image size with wp_customize

Turns out it’s fairly straightforward, just a case of knowing what to search for https://codex.wordpress.org/Class_Reference/WP_Customize_Manager In my tyc_banner_image function I added the last four arguments below. $wp_customize->add_control( new WP_Customize_Cropped_Image_Control($wp_customize, ‘tyc_banner_image-control’, array( ‘label’ => ‘Image’, ‘section’ => ‘tyc_banner_image-section’, ‘settings’ => ‘tyc_banner_image-image’, ‘flex_width’ => true, ‘flex_height’ => true, ‘width’ => 1920, ‘height’ => 500, )));