Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › link in progress bar
New Landing › How can we help? › Themeforest Theme Support › Dante › link in progress bar
- This topic has 13 replies, 3 voices, and was last updated 10 years by Kyle – SUPPORT.
-
Posted in: Dante
-
August 11, 2014 at 9:19 am #99775
Hi!
I would like to make each item of the progress bar a link to another page of the site.
Can you suggest me how to modify the shortcode in order to get this?
Thank you so much!August 11, 2014 at 11:01 am #99847Hi,
in shortcodes.php find the code
/* SERVICES PROGRESS BAR SHORTCODE ================================================= */ function sf_progress_bar($atts) { extract(shortcode_atts(array( "percentage" => '', "name" => '', "type" => '', "value" => '', "colour" => '' ), $atts)); if ($type == "") { $type = "standard"; } $service_bar_output = ''; $service_bar_output .= '<div class="progress-bar-wrap progress-'.$type.'">'. "\n"; if ($colour != "") { $service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value" style="color:'.$colour.'!important;">'.$value.'</span></div>'. "\n"; $service_bar_output .= '<div class="progress '.$type.'">'. "\n"; $service_bar_output .= '<div class="bar" data-value="'.$percentage.'" style="background-color:'.$colour.'!important;">'. "\n"; } else { $service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value">'.$value.'</span></div>'. "\n"; $service_bar_output .= '<div class="progress '.$type.'">'. "\n"; $service_bar_output .= '<div class="bar" data-value="'.$percentage.'">'. "\n"; } $service_bar_output .= '</div>'. "\n"; $service_bar_output .= '</div>'. "\n"; $service_bar_output .= '</div>'. "\n"; global $sf_has_progress_bar; $sf_has_progress_bar = true; return $service_bar_output; } add_shortcode('progress_bar', 'sf_progress_bar');
and replace it with
/* SERVICES PROGRESS BAR SHORTCODE ================================================= */ function sf_progress_bar($atts) { extract(shortcode_atts(array( "percentage" => '', "name" => '', "type" => '', "value" => '', "colour" => '', "link" => '' ), $atts)); if ($type == "") { $type = "standard"; } $service_bar_output = ''; $service_bar_output .= '<div class="progress-bar-wrap progress-'.$type.'">'. "\n"; if ($colour != "") { $service_bar_output .= '<a href="'.$link.'"><div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value" style="color:'.$colour.'!important;">'.$value.'</span></div>'. "\n"; $service_bar_output .= '<div class="progress '.$type.'">'. "\n"; $service_bar_output .= '<div class="bar" data-value="'.$percentage.'" style="background-color:'.$colour.'!important;">'. "\n"; } else { $service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value">'.$value.'</span></div>'. "\n"; $service_bar_output .= '<div class="progress '.$type.'">'. "\n"; $service_bar_output .= '<div class="bar" data-value="'.$percentage.'">'. "\n"; } $service_bar_output .= '</div>'. "\n"; $service_bar_output .= '</div></a>'. "\n"; $service_bar_output .= '</div>'. "\n"; global $sf_has_progress_bar; $sf_has_progress_bar = true; return $service_bar_output; } add_shortcode('progress_bar', 'sf_progress_bar');
This should leave you with the new attribute link=”…” to use within the shortcode!
Let me know if it worked. If it didn’t work, please post up your website URL with the faulty code on it!
August 11, 2014 at 12:24 pm #99914Hi thanks a lot.
I’ve just tried to do it, but I get the error you can check here: http://www.simonacolonna.it/geo_eng/wp-admin/theme-editor.php?file=swift-framework%2Fshortcodes.php&theme=dante&scrollto=16107&updated=trueI also attached a screenshot of the error, please let me know what I can do!
ThanksAttachments:
You must be logged in to view attached files.August 11, 2014 at 12:35 pm #99926Please double check that you copied and pasted the whole code
– Kyle
August 11, 2014 at 12:40 pm #99931This reply has been marked as private.August 11, 2014 at 12:42 pm #99933please go to line 841 and make sure there is not a double semi-colon ‘;;’
– Kyle
August 11, 2014 at 12:48 pm #99936This reply has been marked as private.August 11, 2014 at 12:51 pm #99938Please revert back to the original version of the file, I will have to check the code that Melanie provided
– Kyle
August 11, 2014 at 12:56 pm #99943This reply has been marked as private.August 11, 2014 at 1:11 pm #99952Please delete the theme using ftp and install this version: https://www.dropbox.com/s/aqokzr0d6nnbqbf/dante.zip
– Kyle
August 11, 2014 at 1:23 pm #99962This reply has been marked as private.August 11, 2014 at 2:26 pm #99980After looking into it I don’t think it’s simple to add links to each bar. If you need this functionality you will need to hire a developer
– Kyle
August 11, 2014 at 2:57 pm #100005This reply has been marked as private.August 11, 2014 at 3:10 pm #100011No problem
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.