Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:04:39+00:00 2026-06-15T14:04:39+00:00

I am having issue with WordPress meta boxes. actually I am using WordPress Genesis

  • 0

I am having issue with WordPress meta boxes. actually I am using WordPress Genesis framework and in child theme I had create few meta boxes for my client to show some content before the page content, but in the custom meta box i am using wp-editor and its working fine. but the issue is that when I try to use some shortcodes in this wp-editor then it won’t show me anything, it is just returning the whole shortcode as it is.

I am using https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress for custom meta boxes.

And my codes are in function.php file:

/* -------------------------------------------------------------------------- */
/* Setup Custom metaboxes                                                     */
/* -------------------------------------------------------------------------- */
add_action( 'init', 'be_initialize_cmb_meta_boxes', 9999 );

function be_initialize_cmb_meta_boxes() {
    if ( !class_exists( 'cmb_Meta_Box' ) ) {
        require_once( CHILD_DIR . '/lib/metabox/init.php' );
    }
}

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );

function cmb_sample_metaboxes( array $meta_boxes ) {

    // Start with an underscore to hide fields from custom fields list
    $prefix = '_cmb_';

    $meta_boxes[] = array(
        'id'         => 'text_content',
        'title'      => 'Text Content',
        'pages'      => array( 'page', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields'     => array(
            array(
                'name' => 'Custom Content',
                'desc' => 'This is a title description',
                'id'   => $prefix . 'custom_content',
                'type' => 'title',
            ),  
            array(
                'name' => 'Tab Name',
                'desc' => 'Please descibe the tab name (required)',
                'id'   => $prefix . 'tab_name',
                'type' => 'text',
            ),
            array(
                'name'    => 'Test wysiwyg',
                'desc'    => 'field description (optional)',
                'id'      => $prefix . 'test_wysiwyg',
                'type'    => 'wysiwyg',
                'options' => array( 'textarea_rows' => 5, ),
            ),
        ),
    );

    return $meta_boxes;
}

I save the codes in page.php as:

add_action('genesis_before_loop', 'ehline_before_loop_content');

function ehline_before_loop_content() 
{
    echo genesis_get_custom_field( '_cmb_tab_name' );
    echo '<br />';
    echo genesis_get_custom_field( '_cmb_test_wysiwyg' );
}
genesis();

But when I use the shortcodes in this meta box it return something like that

[wptabtitle] Tab 01[/wptabtitle] [wptabcontent]test[/wptabcontent]

Please anyone tell me how can I make it to use shortcodes in the wp-editor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:04:40+00:00Added an answer on June 15, 2026 at 2:04 pm

    You need to call do_shortcode() for the content of your custom fields. Here is how the updated code should look like:

    add_action('genesis_before_loop', 'ehline_before_loop_content');
    
    function ehline_before_loop_content() 
    {
        echo do_shortcode( genesis_get_custom_field( '_cmb_tab_name' ) );
        echo '<br />';
        echo do_shortcode( genesis_get_custom_field( '_cmb_test_wysiwyg' ) );
    }
    genesis();
    

    Also this will not add the auto-paragraphs that you would usually see for your posts contents. You can do two things:

    echo apply_filters( 'the_content', genesis_get_custom_field( '_cmb_tab_name' ) );
    

    or

    echo wpautop( do_shortcode( genesis_get_custom_field( '_cmb_tab_name' ) ) );
    

    In theory the first one should be better, but sometimes you might get additional output from functions that hook to the the_content filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an issue when developing a WordPress theme. I developed the theme
I'm having an issue with a WordPress theme project I'm working on (the theme
I am trying to create dropdown menu for Wordpress theme and having some silly
I'm coding a Wordpress theme and I'm having an issue displaying 5 dynamic post
I am having an issue with loading some javascript in a child theme I
Hey I am having some issues while using Nggalley plugin for wordpress the plugin
We are having some issue with our relative path in wordpress. Earlier our application
I am having issue with a wordpress Tag CLoud Plugin. I want to show
Well I'm having an issue with Facebook's Open Graph. I have a Wordpress blog
Good afternoon, I am having an issue with wordpress. I access to page123.domain.com and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.