This topic has 7 replies, 4 voices, and was last updated 9 years by drearypanoramic.
-
Author
Tagged: box, feature items, url
-
December 28, 2014 at 23:25 #40495JayjayParticipant
Hi, this may sound like a silly question regarding feature items, I have had a look in the forums and cant find anything. I have added some box styled feature items to my homepage and wondered if it was possible to add a URL to the box directing users to the relevant page when they click.
Attachments:
You must be logged in to view attached files.December 29, 2014 at 01:43 #40505sharmstrModeratorNot directly, but you can add hyperlinks to the text.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 3, 2015 at 03:20 #44481marceltjParticipantI’d like to know if anyone has figured out how to make these link. It seems standard practice that an element with some type of hover or mouse over would suggest an action, like link to a page. As of now, it’s really just look without function.
June 16, 2015 at 06:14 #63064drearypanoramicParticipantI’m also looking to figure this out as well. Any thoughts?
June 16, 2015 at 06:19 #63065drearypanoramicParticipantI suppose you would edit this plugin: k-elements/shortcodes/templates/kleo_feature_item.php, but I’m not sure how you would set it so the link is different for different feature items.
June 16, 2015 at 06:33 #63067drearypanoramicParticipantI figured it out, although this may not be the cleanest way to do this:
You’re going to want to add a URL around the <h3> tags, which wrap the title below: <h3 class=”feature-title”>’.$title.'</h3>. This URL will link to the variable $link, which will search for the string of the title with the following if statement:
$link = “”;if($title == “Get Inspired”){
$link = “get-inspired”;
}Feel free to paste this anywhere between the php tags. You will need to create a new if statement for every new Feature Item, and set the $title variable exactly equal to the title you input using your visual composer.
<?php
/**
* FEATURE ITEM
* [kleo_feature_item]Text[/kleo_feature_item]
*
* @package WordPress
* @subpackage K Elements
* @author SeventhQueen <themesupport@seventhqueen.com>
* @since K Elements 1.0
*/$output = $icon = $icon_size = $icon_position = $class = ”;
extract( shortcode_atts( array(
‘title’ => ”,
‘icon’ => ”,
‘icon_size’ => ”,
‘icon_position’ => ‘left’,
‘class’ => ”
), $atts ) );$class = ( $class != ” ) ? ‘kleo-block feature-item list-el-animated ‘ . esc_attr( $class ) : ‘kleo-block feature-item list-el-animated’;
$icon = ($icon !=”) ? ‘ icon-‘.$icon : ”;
$class .= ($icon_size !=”) ? ” “.$icon_size.’-icons-size’ : ”;
$class .= ($icon_position == ‘center’) ? ” center-icons” : ”;$output .= ‘<div class=”‘.$class.'”>’;
$output .= ‘<span class=”feature-icon el-appear’.$icon.'”></span>’;$link = “”;
if($title == “Get Inspired”){
$link = “get-inspired”;
}$output .= ‘<h3 class=”feature-title”>’.$title.'</h3>‘;
$output .= ‘<div class=”feature-text”>’.do_shortcode( $content ) .'</div>’;
$output .= ‘</div>’;June 16, 2015 at 06:35 #63068drearypanoramicParticipantWhy can’t I edit my posts? Kind of frustrating as I can’t preview my code:
COPY CODE$link = “”; if($title == “Title 1”){ $link = “your-link”; } <a href='.$link.'><h3 class="feature-title">'.$title.'</h3></a>
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.