Forum Replies Created

  • anybody??

  • Just did the latest update and now I’m unable to load the site or WP – getting the following error:

    Fatal error: Call to undefined function get_current_screen() in /Users/Sites/cms/wp/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php on line 3307

    anybody else experiencing this?

  • That did the trick – thank you James!

  • Thank you James

    I’m sure your solution is more advanced – I came up with `if ( strpos( get_field( ‘resource_media’ ), ‘.mp3’ ) )
    echo do_shortcode( get_field( ‘resource_media’ ) );`

    I did the trick as well.

  • that did the trick – thank you Joe.

  • I’m trying to do exactly the same – it’s a pity that the taxonomy field doesn’t provide conditional logic.

  • Thanks for replying Joe
    actually getting the taxonomy terms isn’t the issue – what I’m trying to do is basically simulating the “taxonomy” field using a select field – the reasons for that is that unfortunately the “taxonomy field” doesn’t allow for conditions later on whereas the select field does. I can easily get the terms of the taxonomy and populate the select field but how do I pre-select the terms assigned already to the post when populating the select field – any ideas?

  • Hello
    this might be related – I’m trying to populate the default value of a dynamically populated select field – I cannot get it to display the default value – hope somebody can help.

    // Populate the category select field with dynamic values
    add_filter( 'acf/load_field/name=resource_category', 'prefix_acf_load_resource_category_field' );
    function prefix_acf_load_resource_category_field( $field ) {
    	// reset choices and defaults
    	$field[ 'choices' ] 		= array();
    	$field[ 'default_value' ]	= array();
    	$terms = get_terms( 'resource_category', array( 'hide_empty' => false ) );
    	foreach ( $terms as $term ) {
    		$field[ 'choices' ][ $term->slug ] = $term->name;
    		if ( has_term( $term->slug, 'resource_category', get_the_ID() ) )
    			$field[ 'default_value' ][] = $term->slug;
    	return $field;
  • thanks James but it doesn’t work – interestingly the following does work:

    $args = array(
    		'post_type' 		=> 'ze_knowledge',
    		'orderby'       	=> 'post_date',
    		'order'         	=> 'DESC',
    		'posts_per_page'	=> '-1',
    		'meta_key'			=> 'knowledge_video',
    		'meta_value'		=> ' ',
    		'meta_compare'		=> '!=',			
  • got the same issue

  • put 5.2.8 back and everything works as expected – am I doing something wrong or is there an issue??

  • This reply has been marked as private.
  • not working – I echoed the id – id is certainly correct.

  • I thought the third paramenter in get_field is for the format – nevertheless, plain get_field(‘fld_teaser_content’) doesn’t return anything either whereas get_post_meta always returns the correct value?

    this is the whole function – hope it helps:

    add_filter( 'genesis_before_entry_content', 'custom_entry_content' );
    function custom_entry_content() {	
    	if ( !is_single() )
    	$id = get_the_ID();
    	if ( empty($id) )
    	$teaser_content = get_post_meta( $id, 'fld_teaser_content', true );
    	//$teaser_content = get_field( 'fld_teaser_content', $id, true );
    	if ( empty( $teaser_content ) )
    	$html  = "\n\t"   . '<div class="teaser-box neutral-box">';
    	$html .= "\n\t\t" . '<div class="teaser-header"><h6><i class="icon-pushpin pull-right"></i>Hinweis</h6></div>';
    	$html .= "\n\t\t" . '<div class="teaser-content">' . sanitize_text_field( $teaser_content ) . '</div>';
    	$html .= "\n\t\t" . '<div class="teaser-footer">Bitte <a href="?page_id=38" title="Kontakt">kontaktieren</a> Sie uns für ein unverbindliches Gespräch.</div>';
    	$html .= "\n\t"   .'</div>';
    	echo $html;				
  • something weird is going on here:

    //$teaser_content = get_post_meta( $id, 'fld_teaser_content', true );
    $teaser_content = get_field( 'fld_teaser_content', $id, true );

    the first disabled line of code actually returns the content of the field – however links are not showing as links

    the second line of code doesn’t return the field content

    Hope you got an idea?

    What am I missing

  • Thanks for replying Elliot – actually this is not about converting links to tags – this is about entering plain html code incl. a tags like <a href=…. that do not appear as links in the front-end also I’ve entered the html code properly?

Viewing 16 posts - 1 through 16 (of 16 total)

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.