New Images
-
I have new images that have been created and renamed with the @2x filename to replace existing images with these same filenames. These new ones have been uploaded via FTP but they do not appear when web page is loaded. Please advise.
-
Hey Pixel,
I think we will need more details than that if you want some help. Also please check the FAQ and tutorial first.
I am using the Avada theme. If you look at their demo here – http://themeforest.net/item/avada-responsive-multipurpose-theme/full_screen_preview/2833226 you’ll see under “Recent Work” there is a slider. On mouseover of any of the graphics within the slider, several images appear including a link icon and a magnifying glass icon. I have replaced the link icon with a customized version on my own site. I have also created a @2x version that is retina-ready and uploaded that via FTP. When viewed in a mobile device, only the regular image appears and not the retina-ready version.
I am thinking this may be related to your FAQ item relating to sliders or the fact that it is not in the media library. If this is the case, I am unable to determine where to insert
$(‘img’).each(function(){
new RetinaImage(this);
});Recent Works widget code below:
<?php
add_action(‘widgets_init’, ‘recent_works_load_widgets’);function recent_works_load_widgets()
{
register_widget(‘Recent_Works_Widget’);
}class Recent_Works_Widget extends WP_Widget {
function Recent_Works_Widget()
{
$widget_ops = array(‘classname’ => ‘recent_works’, ‘description’ => ‘Recent works from the portfolio.’);$control_ops = array(‘id_base’ => ‘recent_works-widget’);
$this->WP_Widget(‘recent_works-widget’, ‘Avada: Recent Works’, $widget_ops, $control_ops);
}function widget($args, $instance)
{
extract($args);
$title = apply_filters(‘widget_title’, $instance[‘title’]);
$number = $instance[‘number’];echo $before_widget;
if($title) {
echo $before_title . $title . $after_title;
}
?>
<div class=”recent-works-items clearfix”>
<?php
$args = array(
‘post_type’ => ‘avada_portfolio’,
‘posts_per_page’ => $number
);
$portfolio = new WP_Query($args);
if($portfolio->have_posts()):
?>
<?php while($portfolio->have_posts()): $portfolio->the_post(); ?>
<?php if(has_post_thumbnail()): ?>
” title=”<?php the_title(); ?>”>
<?php the_post_thumbnail(‘recent-works-thumbnail’); ?>
<?php endif; endwhile; endif; ?>
</div><?php echo $after_widget;
}function update($new_instance, $old_instance)
{
$instance = $old_instance;$instance[‘title’] = strip_tags($new_instance[‘title’]);
$instance[‘number’] = $new_instance[‘number’];return $instance;
}function form($instance)
{
$defaults = array(‘title’ => ‘Recent Works’, ‘number’ => 6);
$instance = wp_parse_args((array) $instance, $defaults); ?>
<p>
<label for=”<?php echo $this->get_field_id(‘title’); ?>”>Title:</label>
<input class=”widefat” style=”width: 216px;” id=”<?php echo $this->get_field_id(‘title’); ?>” name=”<?php echo $this->get_field_name(‘title’); ?>” value=”<?php echo $instance[‘title’]; ?>” />
</p><p>
<label for=”<?php echo $this->get_field_id(‘number’); ?>”>Number of items to show:</label>
<input class=”widefat” style=”width: 30px;” id=”<?php echo $this->get_field_id(‘number’); ?>” name=”<?php echo $this->get_field_name(‘number’); ?>” value=”<?php echo $instance[‘number’]; ?>” />
</p>
<?php
}
}
?>Sorry for the late reply. You are using the client-side, right? It is using Retina.js, you should check their forums since there are many many people with this kind of issues.
You should maybe give a try to Server-side method, it “might” work better with your slider. You can also try the HTML Writer (the best method) but depending on how the website is coded, the slider might not work neither.
Please play with those 3 methods. However, if you have a problem with the client method, you should ask on the Retina.js forums, they would know better 🙂
The topic ‘New Images’ is closed to new replies.