1.5RC Feedback - Query loop for custom posts with ACF fields

WOW!!! I just made my first archive page with the new Query Loop, and its fabulous. I wanted an archive for a custom post type, and I wanted to use a field from Advanced Custom Fields, as well as my Meta Descriptions from Yoast.
In the editor, both custom fields just say META, as you can see here:


But on the published page the meta info was pulled without a hitch:

Four pieces of feedback, besides a ton of gratitude and excitedness:

  1. It should be clearer to users how to pull the meta. In practice, its as simple as typing in the field name, but it’s not really clear where to get that name.
  2. The default block for posts links the title to the post, but not the featured image. I think users click the big photo more than the text title, so maybe have the image linked as well. It’s easy to add, but should be default (I think).
  3. Is there a more descriptive way to help users like me resolve the meta preview than this “Live preview is only available to meta exposed to the REST API.” I kind of don’t know what to do next.
  4. (not part of the query loop feedback) - why the change to Pattern Library from local templates? I think of dots and circles and apple paint on the very first Macintosh when I see patterns. Probably just me.

Outside of that, amazing, amazing, amazing. I’m using it on a multisite install without problems - I think the alpha release had a few glitches there, but not the rc.

Hey, in case anyone is trying to use ACF meta or the info from Yoast, I didn’t get the fields in the dropdown menu. For ACF I just typed in the name of the field I was trying to pull, and it found it.
Choose Data source - current post; Data Type - Post Meta, and then in the Post Meta Field (if your screen is blank like mine is) type the field name (wordpress calls it the slug).

To get Yoast’s meta description I just typed _yoast_wpseo_metadesc.

I’m getting the same problem with the released version.
I type in my post meta field name ( Why are these not found and displayed in a drop down? ) but I still just get the “Meta Value” shown in the editor. If it can’t display the actual field then perhaps the field name would help?
On the front end I do see a value - however this is a date field and the output value is just a string. How do I convert that to a date format? Date is in “yyyymmdd” format.
Thx
Alan

I had the same issue when I tried to duplicate this. Nothing in ACF for how to export changed the way generate blocks exported the field.

Hi @alanj and @willwenzel,

If you have your date set as a Post meta as such: Edit Page “Generated Homepa...

You can add class my-date to this Block: Edit Page “Generated Homepa...

Then, with this PHP snippet, you should be able to format the date:

add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
	if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'my-date' ) !== false ) {
		$timestamp = strtotime($content);
		$my_date = sprintf(
		'<time datetime="%1$s">%2$s</time>',
		date('c', $timestamp),
		date('l F j, Y', $timestamp) );
		return $my_date;
	}
	return $content;
}, 10, 3);

Adding PHP reference: Adding PHP - Documentation

Hope this helps!

1 Like

Thanks that helps with the date format. ( I think I’ve been here before! )

Don’t suppose there is anything on why ACF fields are not listed in a dropdown is there? Would make life soooo much easier.

Cheers
Alan