Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.
    #1244820

    Hey 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,
    Victoria

    #1245210

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

    #1245389

    Hi jgax87,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1246402

    the child theme override didn’t work

    #1246792

    Hi 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,
    Victoria

    #1246903

    Actually 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!

    #1246926

    Hi 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.