Site logo

Archived topic

Get customizer value set for container width

7 replies · Started by ic7 on January 21, 2019

Viewing posts 1–8 of 8

Hi there!

How can I get the value that is set for the container width inside the customizer layout section?
I need to use the width value in a template file.
Thanks for your help in advance!

Best regards
Sebastian

Hi Leo, thanks for your reply!

Yes, the value can be set and is showing in the backend / customizer. What I'm asking is, if there is a function to get this value, which is stored in the database, to be echoed in a template file. Just like the value of a custom field for example.

Thanks Leo, but this doesn't solve my problem.
What I need is to get the value of the container width set in the customizer.
If that value is changed at any time, I need that value to be changed as well in my special template file.
The value from the customizer gets saved to the database. So I need to retrieve this exact value via a function, so I can use it in a page template.
Thanks for your help!

Hi there,

Try this:

$width = generate_get_option( 'container_width' );

Let me know :)

Thanks Tom!
Exactly what I needed! Works perfect!
Is there a list of values that can be retrieved from the generate options?

This archived topic is closed to new replies.