- This topic has 7 replies, 2 voices, and was last updated 5 years, 10 months ago by .
Make Clients logos clickables
You must be logged in to reply to this topic.
Hi there,
thanks a lot for this theme, at first!
I’m looking for how to add a link to each logo in Clients section.
Can you please advise how to manage this?
M
Hello @makar
You will need to edit the clients_widgets.php file located in the /inc/widgets/ directory of the theme.
You will need to add a field for the link.
Some knowledge of PHP will be required.
so i’ve modified the output code like this :
function widget( $args, $instance, $instanceb ) {
extract( $args, EXTR_SKIP );
// these are the widget options
$image_url = $instance['image_url'];
$image_link = $instanceb['image_link'];
echo $before_widget;
// Display the widget
echo '';
if( $image_url) {
echo '';
}
echo '';
echo $after_widget;
}
and display form like this:
function form( $instance, $instanceb ) {
$instance = wp_parse_args( (array) $instance, $this->defaults );
$instanceb = wp_parse_args( (array) $instanceb, $this->defaults );
?>
<p>
<input id="<?php echo $this->get_field_id('image_link'); ?>" type="text" class="image-url" name="<?php echo $this->get_field_name('image_link'); ?>" value="<?php echo $instanceb['image_link']; ?>" style="width: 100%;" />
<label for="<?php echo $this->get_field_id('image_url'); ?>"><?php _e('Client Logo', 'integral'); ?></label>
<input id="<?php echo $this->get_field_id('image_url'); ?>" type="text" class="image-url" name="<?php echo $this->get_field_name('image_url'); ?>" value="<?php echo $instance['image_url']; ?>" style="width: 100%;" />
<input id="" class="button upload_image_button" type="button" value="<?php _e('Upload','integral') ?>" />
<input id="" class="button clear_image_button" type="button" value="<?php _e('Clear','integral') ?>" />
</p>
<p class="img-prev">
" style="max-width: 100%;">
</p>
<?php
}
i presume i need more modifications 🙂 with constructor too.. but how? can you please advise ? thanks in advance
Hello @makar
We will release an update for Integral tomorrow which will include the ability to add links to images in the Clients and Brands widgets.
If you can wait until then, it will be done for you.
You’re welcome 🙂
We did release the update so if you go to Appearance > Themes. You can now update the theme and you will be able to enter links for the logos.
You must be logged in to reply to this topic.