outputting wrong image url after migration to live server

  • Unknown's avatar

    I created a custom theme on localhost and everything worked fine. I tried to migrate it to a live server but the images are not working anymore.

    I use this code:
    <img src="<?php bloginfo('template_url'); ?> /images/psy-dev-logo.png" class="header__photo" alt="Site logo">

    In the browser it outputs:
    /wp-content/themes/Blog%20/images/me.jpg

    if I manually remove the %20 in the browser it works fine again, so how can i remove that?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    nvm its a linux server, its very picky about filepaths

    %20 means a space, i have it working now

  • Your PHP is outputting a space (%20) – make sure there is no space before /images in your code.

    These forums are for folks hosted here on WordPress.com.

    Since yours is a self-hosted site, you can ask for help in the WordPress.org forums:

    http://wordpress.org/support/

    You’ll need a free WordPress.org account to post – if you don’t already have one, you can register here:

    https://wordpress.org/support/register.php

  • The topic ‘outputting wrong image url after migration to live server’ is closed to new replies.