How to make Team members descriptions clickable in Zerif PRO

Important notice: This product is now in maintenance mode and is no longer being actively developed or supported. Updates and bug fixes will not be provided unless they relate to security concerns.

If you are using Zerif PRO along with the built-in Team member widgets, you may want to somehow enhance the widget's behaviour by making the descriptions linking to the same URL as the member's names are ( The Website link option available in each Team member widget).

This can be achieved by creating a child theme and making the following changes.

- First, navigate to your parent theme ( Zerif PRO ) folders, to inc > class > class-zerif-team-widget.php and copy the zerif_team_widget class from there ( You need to copy the whole code between < and including > class zerif_team_widget extends WP_Widget to the second to last } character ).

- Copy that code in your child theme's functions.php file.

- In your child theme's functions.php in the newly added code find this part:

<?php
if ( ! empty( $instance['description'] ) ) :
    $zerif_widget_description = wp_kses_post( $instance['description'] );?>
    <div class="details">
   <?php echo htmlspecialchars_decode( apply_filters( 'widget_title', $zerif_widget_description ) ); ?>
   </div>
<?php endif; ?>

and replace it with:

 <?php
                if ( ! empty( $instance['description'] ) ) :
                    $zerif_widget_description = wp_kses_post( $instance['description'] );
                    ?>
                    <div class="details">
                        <?php if ( ! empty( $instance['profile_link'] ) ) { ?>
                            <a style="color:#fff;" href="<?php echo apply_filters('widget_title', $instance['profile_link']); ?>">
                            <?php
                            if (isset($zerif_accessibility) && $zerif_accessibility == 1) {
                                ?>
                                <span
                                    class="screen-reader-text"><?php _e('Go to', 'zerif'); ?><?php echo apply_filters('widget_title', $instance['title']); ?></span>
                                <?php
                            }
                        } ?>
                        <?php echo htmlspecialchars_decode( apply_filters( 'widget_title', $zerif_widget_description ) ); ?>
                        <?php if ( ! empty( $instance['profile_link'] ) ) { ?>
                            </a>
                        <?php } ?>
                    </div>
                <?php endif; ?>

Save the code and make sure you change the style attribute to better match what you need in terms of styling for that section.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us