Issues with Global Blocks and ACF

Hello Support,

I am experiencing a strange behaviour of a page template I am creating for a client.
I worked with Global Blocks, CPT and ACF to create a page template where I load Global Blocks.
When I preview my post on time in two the block for the main text is not showing.
There is a single-cptname.php and in the framework/views/ethos I have content-cptname.php and wp-single-cptname.php

I have created a special WYSIWYG editor ACF field to output the content. When I reload the preview it doesn’t show neither but when I make an other trial the text is finally showing.
Technically, it happens on time in two. It is strange because the template seems to work fine for the CPT, the custom header is loaded correctly, my author box on the side is fetching the right data, it is just the main section with the text that load one time in two.

Can you please help?
S.

Hello @SachaDesign,

Thanks for writing in! It is best that we investigate your custom page template and the codes in it. To better assist you with your issue, kindly provide us access to your site so that we can check your settings. Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Regards.

Hello Ruenel,

Thanks, I have added the credentials and access.

Thanks,
S.

Hi @SachaDesign,

Please consider that this is a customization question which is outside of our support scope, we will do our best to help you figure out the problem cause but we can not guarantee implementation.

I checked your website and the custom post type retrieves the information with no problem. But the way that you want to use the content of the blog inside a Global block is not correct in my opinion.

The Global Block does not know which Commentaries post you are talking about. That is why if you set it to the current post it will not show a thing as it does not know which post to show. But if you select the Dynamic content to show a specific post and set the ID of that post it will retrieve the information correctly.

I went to the Global Block and added a new Text element and added proper information and it shows the content correctly.

{{dc:acf:field post="22" field="field_5e528ee518f8e"}}

Thank you.

Dear Christopher,

Thanks for your help.
Although is there no way to define something as “curent commentary”?
If I want to use the Global blocks as a template?

Cheers,
S.

Hi @SachaDesign,

Unfortunately, it is not available for global blocks right now. It might be possible with customization but that would be outside the scope of our support. Thank you for understanding.

Dear Lely,
It must be possible. If you say it is but I will consider to change the theme to something that suits better my clients’ needs.

Best regards,
S

Hey S,

For custom single and archive pages, I’d recommend you kindly wait for our upcoming Layout Builder. Right now, this would really need custom development.

Thanks.

Hello,

I hope it will arrive soon because I have to deliver, I will investigate an other theme.
Something I don’t understand is I managed to create templates for Custom post types on a different project and everything was fine, and now you tell me that it is not possible, I don’t understand.

Best,
S.

Hello @SachaDesign,

The Layout Builder is an on going development. We do not have an ETA yet.
It will be available soon.

Cheers.

Thanks,
But how do you explain I could do it on other projects but not anymore? I am sure there is an explanation.
I will try another solution if the builder is far to be released.
Cheers

Hey S,

I’m not sure what you mean “I could do it on other projects but not anymore”. If you have achieved something on another project, you can copy the setup from the working project.

What we were saying is or specifically, what Lely said is this is not possible out of the box:

That would require custom development and that is beyond the scope of our support so you will need a developer to write custom code, probably a custom shortcode to achieve that. It’s technically possible but we will not provide support for that.

Thank you for understanding.

It means that I have already created templates for CPT using X and it was fine.
I have of course used the same principles, in order to not reinvent the wheel. I don’t think you understood the problem, all my Global blocks elements appear normally, Just the text is showing one one time in two.

Nevermind, I am exploring other themes right now to satisfy my client’s need.

Best regards,
S

HI S,

We hope that you find a solution for your needs.

Very helpful thanks :smile:

So no one can’t tell where this display bug comes from?

Hi @SachaDesign,

We already explained the situation with the feature that you want to achieve which it is not possible because the Global Block is not part of the WordPress main loop. That is why it can not detect the Custom Post Type that you want. You need to provide the exact ID of the post in question for the Global Block so that it can show the title of the post or the content outside of the main WordPress loop.

Unless we did not understand the problem correctly there is nothing that we can do more here. If you think we did not understand the problem correctly, please create a screencast and give us detailed information and also give us the link to the other project that you said you successfully managed to retrieve data.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.