Support

Account

Home Forums Backend Issues (wp-admin) Help with $field_name shortcode

Unread

Help with $field_name shortcode

  • Hello. Sorry if this has been addressed before, but I couldn’t find it in the forums and I’m not very good with PHP.

    I have added an ACF custom field to my WordPress Themes Portfolio Posts. I have named it Video and Audio (field name is: video_and_audio)

    In the portfolio template, it uses AJAX (I think) to display the portfolio post dynamically from the grid when a thumb is clicked on.

    The HTML is generated in the functions.php file.

    My issue is that I cannot get the field to display using ‘.$field_name.’ or ‘.$video_and_audio.’

    The output is blank and the div is empty

    Does anyone have any advice on this?

    See: “WANT TO PLACE FIELD SHORTCODE HERE” below

    
    // Generate the portfolio item HTML
    	$portfolio_html = '<div class="gallery flexslider"><ul class="slides">'.$image_list.'</ul></div>';
    	$portfolio_html .= '<div class="portfolio-media">WANT TO PLACE FIELD SHORTCODE HERE</div>';
    	$portfolio_html .= '<div class="portfolio-meta col_7">';
    	$portfolio_html .= '<h1><a href="'.$post_link.'" class="portfolio-title">'.$post_title.'</a></h1>';
    	if(has_excerpt($post_ID)){
    		$portfolio_html .= '<h2 class="portfolio-excerpt">'.$post_excerpt.'</h2>';
    	}
    	$portfolio_html .= '<ul class="portfolio-info">'.$post_info_html.'</ul>';
    	$portfolio_html .= '<div class="portfolio-content">'.$post_content.'</div>';
    	$portfolio_html .= '<a href="'.$post_link.'" class="more-link">';
    	$portfolio_html .= __('Read more', 'handbook');
    	$portfolio_html .= ' <span>&rsaquo;</span></a>';
    	$portfolio_html .= '</div><div class="clear"></div>';
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.