-
AuthorPosts
-
September 9, 2020 at 9:11 pm #1244684
Hello all…
So i am trying to see if there is a way to modify the portfolio excerpt through functions.php without having to modify the actual template file through like filter or a hook?
The client is having issues trying to get FTP so i can’t copy the template file into the child at this very moment, so i thought there might be a way to execute the below code in a filter or hook that connects to the portfolio excerpt. I was able to make it into a shortcode which works great when you are within the page, but i know shortcodes do not execute within excerpts.
any help will be great!
function sociallinks () { $facebook = get_field('facebook'); $twitter = get_field('twitter'); $instagram = get_field('instagram'); $website = get_field('website'); $html .= '<div class="social">'; $html .= '<ul class="menu simple rdo-social">'; if(get_field('facebook')) { $html .= '<li><a href="'. $facebook . '" target="_blank"><i class="fa fa-facebook"></i></a></li>'; } if( get_field('twitter') ) { $html .= '<li><a href="' . $twitter . '" target="_blank"><i class="fa fa-twitter"></i></a></li>'; } if( get_field('instagram') ) { $html .= '<li><a href="' . $instagram . '" target="_blank"><i class="fa fa-instagram"></i></a></li>'; } if( get_field('website') ) { $html .= '<li><a href="' . $website . '" target="_blank"><i class="fa fa-home"></i></a></li>'; } $html .= '</ul></div>'; return $html; } add_shortcode( 'sociallinks', 'sociallinks' );
- This topic was modified 4 years, 2 months ago by jgax87.
September 10, 2020 at 10:08 am #1244820Hey Jason,
Here is a list of Enfold’s hooks and filters:
Maybe this thread can give you an idea:
But I do not see a filter that can help you.
Best regards,
VictoriaSeptember 11, 2020 at 6:20 pm #1245210Damn okay. Well i finally got cpanel credentials but i did see that documentation but I tried to do the child theme override but it didn’t pick up i had it at
wpc-child/shortcodes/
i am not sure if should hve changed the file path or not because ive done other templete changes and it picked up.
September 12, 2020 at 5:30 pm #1245389Hi jgax87,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaSeptember 16, 2020 at 8:54 pm #1246402the child theme override didn’t work
September 18, 2020 at 12:44 pm #1246792Hi jgax87,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaSeptember 18, 2020 at 7:11 pm #1246903Actually i got it to work! sorry for the back and forth. I needed to add the function to change the theme override path all is well now!
September 18, 2020 at 8:01 pm #1246926Hi jgax87,
No worries, as long as you got it working for you – all is well:)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.