When I then update the theme, the icons are lost again, right? I have tried placing them in the child theme - with the same folder structure, but that does not work. Do I have to make changes in the functions.php of the child theme?
you need to implement shortcodes.php in child theme, include it in child functions.php with get_stylesheet_directory() and in shortcodes.php use get_stylesheet_directory_uri() instead of get_template_directory_uri for team members shortcode.
- call remove_shortcode to remove parent's implementation as shown in the example
- add your child implementation but just the rename the function differently to avoid the conflict with the parent's function definition (I added an '_ex' at the end, for example)
Would you be able to show me the hidden example please, as I've followed this thread but something's still not working. I'm trying to adjust the shortcode of the team member.
No, it was to adjust the maximum number of words permitted (to 250) in the team member description. I saw from another answer where to adjust the shortcodes.php file for this, no problem there. However, I'm using a child theme, and to adjust the shortcode, I needed to do something like in your answer to user Ka below. I've actually done it now but i'd be interested if you think it's the correct way. I did this:
Hallo there.
Is ist possible to have custom icons in the team profile area?
There exists no icon for Xing and no icon for sending a message per Mail (like an envelope icon) How can I add these?
Thanx, Ka
Hello, go to social_icons folder in the newave theme folder
add an image for xing and mail and specify attribute social_link1, 2 or 3 as their name
For example
xing.png
social_link1="xing"
and for mail specify mailto as link url
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
When I then update the theme, the icons are lost again, right?
I have tried placing them in the child theme - with the same folder structure, but that does not work. Do I have to make changes in the functions.php of the child theme?
Yes, that's correct
you need to implement shortcodes.php in child theme, include it in child functions.php with get_stylesheet_directory() and in shortcodes.php use get_stylesheet_directory_uri() instead of get_template_directory_uri for team members shortcode.
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
Cool, it works!
Thanx, Ka
I think actually you include shortcodes.php from parent theme
Use get_stylesheet_directory function to include the file from child theme folder
https://codex.wordpress.org/Function_Reference/get_stylesheet_directory
// Shortcodes
require_once( get_stylesheet_directory() . '/shortcodes.php');
You can add this line first in you child's functions.php
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
Hello Ka,
the trick was to remove first the old shortcode and add the new one implemented in child's shortcodes.php
In fact the only code that I added was there. It can serve you as a model in case you need to redefine shortcodes in child theme.
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
Hello, when you have to redefine the shortcode:
- call remove_shortcode to remove parent's implementation as shown in the example
- add your child implementation but just the rename the function differently to avoid the conflict with the parent's function definition (I added an '_ex' at the end, for example)
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
Thanks, you can close that ticket!
Hi
Would you be able to show me the hidden example please, as I've followed this thread but something's still not working. I'm trying to adjust the shortcode of the team member.
Thanks
Hi Andy, what exactly you are trying to adjust? is this about the team carousel shortcode?
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy
No, it was to adjust the maximum number of words permitted (to 250) in the team member description. I saw from another answer where to adjust the shortcodes.php file for this, no problem there. However, I'm using a child theme, and to adjust the shortcode, I needed to do something like in your answer to user Ka below. I've actually done it now but i'd be interested if you think it's the correct way. I did this:
In my child functions.php file, I added this:
---------------------------------------------------------------------------------------------------------------------
require_once( get_stylesheet_directory() . '/shortcodes.php');
add_action(‘init’, ‘remove_parent_theme_shortcodes’);
function remove_parent_theme_shortcodes() {
remove_shortcode('team_member');
------------------------------------------------------------------------------------------------------------------
Then I added a child shortcodes.php file, which was this:
add_shortcode( 'team_member_ex', 'shortcode_team_member_ex' );
function shortcode_team_member_ex($atts, $content = null) {
$out = '';
$out .= '<li class="team-person ' . translate_fx_effect( $atts['fx_effect'] ) . '">';
if($atts['picture']){
$out .= '<img src="' . $atts['picture'] . '" alt="" />';
}
$out .= '<div class="team-profile">';
$out .= '<h5>'.$atts['name'].'</h5>';
$out .= '<p>' . $atts['title'] . '</p>';
$out .= '<p class="about-team">' . substr( $content, 0, 250 ) . '</p>';
$out .= '<ul class="socials-icons">';
if($atts['social_link1'] && $atts['social_link1_url'] ) {
$out .= '<li><a target="_blank" href="'. $atts['social_link1_url'] .'"><img alt="" src="'.get_template_directory_uri().'/images/social_icons/' . $atts['social_link1'] . '.png"></a></li>';
}
if($atts['social_link2'] && $atts['social_link2_url']) {
$out .= '<li><a target="_blank" href="'. $atts['social_link2_url'] .'"><img alt="" src="'.get_template_directory_uri().'/images/social_icons/' . $atts['social_link2'] . '.png"></a></li>';
}
if($atts['social_link3'] && $atts['social_link3_url']) {
$out .= '<li><a target="_blank" href="'. $atts['social_link3_url'] .'"><img alt="" src="'.get_template_directory_uri().'/images/social_icons/' . $atts['social_link3'] . '.png"></a></li>';
}
$out .= '</ul>';
$out .= '</div>'; // div class team profile
$out .= '</li>'; // li team person
return $out;
}
------------------------------------------------------------------------------------------------------------------------
I couldn't get it to work unless I renamed the shortcode to 'team_member_ex', which isn't ideal really - any ideas?
Thanks for your help
Hi Andy,
send us wp admin access if possible with full rights using Appearance -> Editor. In a private comment.
Thank you.
Clapat Support
https://www.clapat.com/
Review Envato Item Support Policy