Global block does not go inline in a description

Hello, i have some duplicated descriptions (made with global blocks) with changing numbers in it, so i use a global block for thoses numbers too, but when i integrate the global block number in the description, it does not stay in one line, as you can see here.

how to have the description and the global block in one line ?

Hi @Lyser,

Thanks for reaching out. A Global Block is meant to bring a layout of its own with at least one Section. It can’t effectively inline like you’re trying to do. If you’re trying to manage content globally, one solution would be using ACF (plugin included with the theme) and setting up an Options page in a child theme. You can learn about this here: https://www.advancedcustomfields.com/resources/options-page/

Once you have the page setup and some values defined, you can use Dynamic Content in the page builder to pull values from your option page. These will be output as simple strings so they will work inline and won’t reformat your content.

Ok thx, it seems i need to know programming language to use ACF, is this PHP only ?

Hi @Lyser,

You just need to know how the ACF works and Yes, ACF is on PHP. I also want you to check this article that might help you understand how ACF works.

Hope that helps.

Thank you.

thx you !
i installed acf and followed every step to create a option page.

the php code i used :

if( function_exists('acf_add_options_page') ) {

acf_add_options_page(array(
	'page_title' 	=> 'Options page',
	'menu_title'	=> 'Options',
	'menu_slug' 	=> 'theme-general-settings',
	'capability'	=> 'edit_posts',
	'redirect'		=> false
));
}

Then i added a acf field and linked it with the option page as you can see here :

Could you show me how to link correctly that value (field name is armure1) in the description, i tried this but it’s not working, what did i do wrong ? :

<?php the_field('armure1', 'option'); ?>

It is said here that the second parameter ‘option’ is the name of the page, but where can i see that page name ?

Hi @Lyser,

It is very difficult to recognize the issue you are having without seeing the way you have added the ACF fields into the Options page. I would still like to request you go through the following articles on the ACF options page.



If that does not help, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Ok, the option page is identified with the “menu slug” which is “theme-general-settings” so i replace it in the code, but it still not working, i don’t know what’s wrong, if you could tell me why… =)

you will find login credential in secure note.
The description i try to do is the global block called “le vent mortel” ([cs_gb id=1418]) and it’s result is in the first accordion named 'Alliance de daguefillante" of french homepage version. (clic accordion and hover icon to see description) :

Hi @Lyser,

To display the data from the options page, your code must be <?php the_field('armure1', 'option'); ?> but you can’t directly add a PHP code to the text element or any of the builder because that code is only applicable with the PHP files. To display your data, we have a feature that integrates the ACF field to cornerstone using the dynamic content. For example, if you want to display the armure1 from your options page in your Global blocks, your code must be {{dc:acf:option field=“armure1”}}.

If you don’t know the exact dynamic content, just click this small icon and search for ACF.

image

Please go read our documentation for more information:

Hope that helps.

Thank you.

It’s workiiiing ! Life wiil be so much easier now ! =)
Thx you very much, awesome support !!

You’re very welcome, @Lyser!

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