Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Metabox are not showing in index.php/blog page

  1. Hi,
    I have crated Metabox('post_type' => 'page',) but this is not working in my index.php(Blog Page)

    Posted 1 year ago #

  2. Codestar
    Admin

    Hi,

    "not showing" ? Do you mean it doesn't get correct with get_post_meta ?

    Regards, Codestar

    Posted 1 year ago #
  3. <b>Warning</b>: Illegal string offset 'page-header-tabbed' in <b>C:\xampp\htdocs\nasiha\wp-content\themes\nasiha\index.php</b> on line <b>17</b>

    <b>Warning</b>: Illegal string offset 'page-header' in <b>C:\xampp\htdocs\nasiha\wp-content\themes\nasiha\index.php</b> on line <b>17</b>

    Posted 1 year ago #

  4. Codestar
    Admin

    Hi,

    According to the metabox working principle it must save once. Therefore you must control the options. for eg:

    $meta = // it's your meta data.
    
    if ( isset( $meta['page-header'] ) && $meta['page-header'] === 'yes' ) {
      // do stuff.
    }CopyCopied!

    If you do not get it, share a core part from index.php I can show you detailed.

    Regards, Codestar

    Posted 1 year ago #