Does anyone know how to make resize.php to work in codeigniter?
Below is my code used before CI and it worked perfectly fine before I decided to upgrade, now I'm facing this issue.
<img class="media-object" src="funcs/resize.php?src=customers/400.jpg&w=60" alt="...">
I have tried the code below, but with no luck!
<img class="media-object" src="<?php echo base_url();?>funcs/resize.php?src=<?php echo base_url('customers/400.jpg'); ?>&w=60" alt="...">
I also gave this a try:
<img class="media-object" src="<?php echo base_url();?>funcs/resize.php?src=<?php echo base_url();?>customers/400.jpg&w=60" alt="...">
I am new to CI and I don't know what else to try.
Related
I'm trying to load an image using bloginfo('template_directory')
My code:
<img class="img-fluid" style="max-height: 500px" src="<?php bloginfo('template_directory'); ?>/assets/home-image.png" />
The assets folder is inside my theme folder.
It works perfectly in my localhost.
But when I upload the code to my server I doesn't show the image.
When I inspect the element, here what it shows:
<img class="img-fluid" style="max-height: 500px" src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%200%200'%3E%3C/svg%3E" data-lazy-src="https://www.mywebsite.com/wp-content/themes/mytheme/assets/home-image.png">
Any guess?
Okay. I figured out that WP Rocket plugin was the problem. I had to disable the cache for imagens into the settings of that plugin.
I can't retrieve images from storage and I don't know why. I tried many ways but not working. I ran the following command:
php artisan storage:link
I tried these but none of it worked :
<img src="/storage/images/{{$slide->image}}" class="d-block w-100" alt="...">
<img src="{{asset('/storage/images/'.$slide->image)}}" class="d-block w-100" alt="...">
<img src="{{Storage::get('public/images/', $slide->image) }}" class="d-block w-100" alt="...">
php artisan storage:link creates a symbolic link from public/storage to storage/app/public.
So you have to call public/storage/images/ to access the image.
So in your blade you need to link the source to something like this:
<img src="{{ asset('storage/app/images/'.$slide->image) }}"></img>
$url = url('storage/app/public/images/') . $variableName;
<img src='.$url.'>
I have one template & i used base_url() to load the logo. In source the path can be accessible but the logo is not loading into the webpage ?
<a href="index.html" class="logo">
<img src="<?php echo base_url('assets/frontend/img/logos/logo.png'); ?>" alt="logo">
</a>
When i use without logo class its working
<img src="<?php echo base_url('assets/frontend/img/logos/logo.png'); ?>" alt="logo">
How i can load the logo within logo class ?
website: www.e-veloce.com
I don't see logo.
I tried to change src in header.tpl to
<a href="{$base_dir}" title="{$shop_name|escape:'html':'UTF-8'}">
<img class="logo img-responsive" src="https://www.e-veloce.com/presta/img/logo.jpg" alt="{$shop_name|escape:'html':'UTF-8'}"{if $logo_image_width} width="{$logo_image_width}"{/if}{if $logo_image_height} height="{$logo_image_height}"{/if}/>
</a>
after that, I don't see logo
logo.jpg file is in presta/img/logo.jpg - so it looks good
Any ideas ?
It happens after I made SSL certification.
You have indicated an incorrect path, simply delete /presta/. Based on your code, this should work:
<a href="{$base_dir}" title="{$shop_name|escape:'html':'UTF-8'}">
<img class="logo img-responsive" src="https://www.e-veloce.com/img/logo.jpg" alt="{$shop_name|escape:'html':'UTF-8'}"{if $logo_image_width} width="{$logo_image_width}"{/if}{if $logo_image_height} height="{$logo_image_height}"{/if}/>
</a>
Use this:
src="{$base_dir_ssl}img/logo.jpg"; // https://www.e-veloce.com/img/logo.jpg
src="{$base_dir_ssl}presta/img/logo.jpg"; // https://www.e-veloce.com/presta/img/logo.jpg
I found solution. You need to do:
<img class="logo img-responsive" src="img/logo.jpg" alt="Veloce - Chemia od nas, dla Ciebie" width="367" height="54">
so i cut src with https:// only to img/logo.jpg.
Problem is popular, I hope that solution will help someone in future
I started to learn Wordpress and I'm making my own theme. Within the design I have some images that are supposed to show up... but they don't.
I was using this code:
<div class="col-xs-4">
<img src="images/html_brand.jpg" class="img-responsive">
</div>
and then I found I should use php to link to my image:
<div class="col-xs-4">
<a href="#">
<img src="<?php bloginfo('stylesheet_directory'); ?>html_brand.jpg"
class="img-responsive">
</a>
</div>
But the problem is, the image still doesn't get displayed. And yes I did upload them to my web server. I have them in the directory of my theme: mythemename/images/html_brand.jpg
If you use bloginfo() to output your theme path, you need to add another /, followed by the remaining path to your image. Based on where you've placed your image, this should work:
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/html_brand.jpg" class="img-responsive">
However, bloginfo() ultimately relies on get_template_directory_uri() to work, so you might as well just use that:
<img src="<?php echo get_template_directory_uri(); ?>/images/html_brand.jpg" class="img-responsive">
Slight Correction:
bloginfo() with the specific argument of stylesheet_directory actually relies on get_stylesheet_directory_uri() to function -- get_template_directory_uri() like I originally said.
https://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/general-template.php#L439