Jennifer Waller
asked 5 years ago

Good day,

I recently picked up the Kido theme from Creative Market, and am having an issue with the logo and code changes to resize it not working.

I found the add_image_size( ‘logo’, size, size ); in the init.php file, and input my desired logo dimensions. However I’m wondering if there is something I missed, or if there is another issue at play.

No matter what changes I make to the size of the image it does not display at the new size. Also, when I attempted to change the image (I tried to change from my logo to a photo for testing purposes) the new image did not overwrite the old.

When I attempted to troubleshoot by deleting all media files that I had attempted to use and upload fresh it still did not take a new image at all and only displayed the site title, even when site-logo is selected. It just put a border around the title.

I then deleted the theme and reinstalled it, twice. I attempted to re-upload the logo fresh, but once again it does not take at all and I am left with a border around the site title despite having site logo selected.

I have performed standard troubleshooting such as deleting browser cache. I do not have a caching plugin on the install yet, and when I make other modifications (such as a color change) they appear instantly so I doubt server side caching is causing the problem.

Any assistance in tracking down the issue so I can correct it would be appreciated.

Tech Details: Theme installed on fresh install of wordpress 4.2.2. Site is a subdomain, but that shouldn’t matter.

1 Answers
Allen
answered 5 years ago

@Jennifer Waller : at first, about the logo in customizer we sorry about that ,it’s our bug , so , to resolve that problem, you can go to inc/customizer.php. go to line 452 and modify the function dw_kido_get_attachment_id_by_url( $url ) to

function dw_kido_get_attachment_id_by_url( $url ) {
  $parsed_url  = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );
  $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
  $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );

  if ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {
    return;
  }

  global $wpdb;
  $logo_id = get_option( 'dw-logo' );
  $logo_url = wp_get_attachment_url( $logo_id );
  if ( $logo_url !== $url ) {
    $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;", $parsed_url[1] ) );
    $logo_id = $attachment[0];
    if ( isset( $logo_id ) ) {
      update_option( 'dw-logo', $logo_id );
    } else {
      add_option( 'dw-logo', $logo_id );
    }
  }
  return $logo_id;
}

Second : about add_image_size() : it add a new size of image to the media when you upload new image. For old image you need install plugin regenerate-thumbnails to regenerate it.Link here: https://wordpress.org/plugins/regenerate-thumbnails/

Sorry for that inconvenience. Sincerely.

phoenixwaller
replied 5 years ago

Beautiful! You guys are awesome.

That worked perfectly. Thank you so much!

Powered by DW Question & Answer Pro