WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Change the custom field image path from relative to absolute (multisite)

[Resolved] Change the custom field image path from relative to absolute (multisite)

  • WordPress Popular Posts allows the use of custom fields for image thumbnail, however it generates a relative path.

    In my theme I call the['baseurl'] for the image, which is flexible for both single WordPress and Network multisite, however the relative path is preventing thumbnail from showing up.

    The plugin’s wordpress-popular-posts files call {$path}.

    The baseurl code in my template file is:

    <?php $uploads = wp_upload_dir(); echo $uploads['baseurl'] . '' ;?>

    How can I replace the{$path} with my code so that it pulls the full baseurl?

    Reqeust: could the plugin author adds this to the next upgrade ?

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Hector Cabrera

    @hcabrera

    Hi there,

    Why not simply type in the full path to the image URL instead? (eg. http://yoursite.tld/path/to/your/image.jpg). WPP doesn’t prepend anything to the image path.

    Hi, thanks for the reply.

    It’s a theme for public therefore I would like to make it less laborious for user, e.g. user can enter just the image name without month and date as the url or baseurl can take care of it.

    But I do see your point, and the reason why WPP doesn’t prepend anything to the image path especially if the image is from external source (in my case I have a different custom field for this purpose).

    Plugin Author Hector Cabrera

    @hcabrera

    You’re right, that’s why I decided not to alter user’s input since it can cause trouble with people wanting to use full paths instead 😛

    I’ll try to come with a suitable solution for you, for the time being if you have a suggestion it’ll be more than welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Change the custom field image path from relative to absolute (multisite)’ is closed to new replies.