This topic has 7 replies, 4 voices, and was last updated 9 years by drearypanoramic.

  • Author

    Tagged: , ,

  • #40495
     Jayjay
    Participant

    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.
    #40505
     sharmstr
    Moderator

    Not 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #40931
     Jayjay
    Participant

    thanks for the prompt answer

    #44481
     marceltj
    Participant

    I’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.

    #63064
     drearypanoramic
    Participant

    I’m also looking to figure this out as well. Any thoughts?

    #63065
     drearypanoramic
    Participant

    I 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.

    #63067
     drearypanoramic
    Participant

    I 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>’;

    #63068
     drearypanoramic
    Participant

    Why 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>
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?