Support

Account

Home Forums Bug Reports get_field image returns ID only on search results page (PRO) Reply To: get_field image returns ID only on search results page (PRO)

  • @zychu69 hey thanks! i would have not guessed that we would have to add the post types from ACF.

    i removed the implementation in functions, cause when i added the ACF fields they would get returned within the search results.

    i just needed to supress page post_type from search

    found this that helped me if anyone is interested:

    /**
     * update_my_custom_type
     *
     * @author  Joe Sexton <joe@webtipblog.com>
     */
    function update_my_custom_type() {
    	global $wp_post_types;
     
    	if ( post_type_exists( 'page' ) ) {
     
    		// exclude from search results
    		$wp_post_types['page']->exclude_from_search = true;
    	}
    }