WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Change the custom field image path from relative to absolute (multisite) (4 posts)

  1. alsd
    Member
    Posted 1 year ago #

    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/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. alsd
    Member
    Posted 1 year ago #

    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).

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    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 :P

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic