Site logo

Archived topic

Display custom field content in Query Loop

3 replies · Started by Anastasia on June 21, 2022

Viewing posts 1–4 of 4

Greetings everyone.
I create a custom post type for team members through functions.php I add a custom field using the default custom fields of wordpress and then I use Elements to make a layout for the custom posts' single post layout so I can display the custom field info under post Title. Till here everything works like a charm.

I create into another page a section where I add a query loop in order to display posts of that custom post type. The problem is that I can't echo the custom field . I get only the post title and featured image.

So I'd like to ask if there is any kind of method that I could display that piece of information as well. Notice though that I don't use ACF. If generatepress can't dive so deep, is it possible to create any kind of shortcode containing the information of that custom field I need and use it as a shortcode inside my loop ?

Hi Anastasia,

It this field of information in form of a text? If so, you can use a GB Headline Block as well.

You’ll need to enable Dynamic Data in its Block settings, and set the content source to post meta. Then, set the post meta field to the one you set in ACF.

Example: https://share.getcloudapp.com/nOuXDyRb

Hope this helps!

Greetings Fernando,
There is no Dynamic data panel available for a reason. I have the latest version of the theme and generate blocks basic and pro version

This archived topic is closed to new replies.