Display using a shortcode

Support MB Settings Page Display using a shortcodeResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37354
    Daniel CanupDaniel Canup
    Participant

    I have created an Options page with the ID of site_settings. Within the page I have a few tabs(if this matters at all.) This Options page has a Custom field with the ID of promotion_banner. I am using the following code in the area I wish to display this output. However, it isn't working. How do I get it to?

    [rwmb_meta id="promotion_banner" object_id="site_settings"]

    #37355
    Daniel CanupDaniel Canup
    Participant

    I have also tried just this...

    [rwmb_meta id="promotion_banner"]

    I am putting it in an HTML WYSIWYG editor in the Header of the WP Customizer.

    #37362
    Long NguyenLong Nguyen
    Moderator

    Hi Daniel,

    The correct shortcode to get the field value in a settings page should be (you miss the attribute object_type)

    [rwmb_meta id="phone" object_id="site_option" object_type="setting"]

    phone is the field ID
    site_option is the option name, not the settings page ID

    Please read more on the documentation https://docs.metabox.io/shortcode/
    https://docs.metabox.io/extensions/mb-settings-page/

    #37363
    Daniel CanupDaniel Canup
    Participant

    What exactly is an "option name"

    Custom Field Group?

    #37364
    Daniel CanupDaniel Canup
    Participant

    I mean I see this: Option name where settings data is saved to. If you want to use theme mods, then set this to theme_mods_$themeslug.

    My options page is named "site_settings"

    #37366
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If you are using the builder, you can see the option name when editing the settings page, screenshot https://imgur.com/0boG3lD

    #41989
    OldGregOldGreg
    Participant

    This "Option Name" shown in your screenshot, Long, is not a field in my settings page.

    #41999
    PeterPeter
    Moderator

    Hello,

    The Option Name input is moved under the ID input when clicking on the Advanced text. Please read more in the documentation https://docs.metabox.io/extensions/mb-settings-page/#creating-settings-pages

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.