Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created August 26, 2014 11:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tommcfarlin/310c253d37a688de58b9 to your computer and use it in GitHub Desktop.
Save tommcfarlin/310c253d37a688de58b9 to your computer and use it in GitHub Desktop.
[WordPress] An example of cleanly organizing the front end of a custom meta box tabbed interface.
<div id="acme-navigation">
<h2 class="nav-tab-wrapper current">
<a class="nav-tab nav-tab-active" href="javascript:;">Extended Description</a>
<a class="nav-tab" href="javascript:;">Related Files</a>
<a class="nav-tab" href="javascript:;">Similar Posts</a>
</h2>
</div>
<?php include_once( 'partials/extended-description.php' ); ?>
<?php include_once( 'partials/related-files.php' ); ?>
<?php include_once( 'partials/similar-posts.php' ); ?>
<div id="custom-meta-box-nonce" class="hidden">
<?php echo wp_create_nonce( 'acme-custom-meta-box-nonce' ); ?>
</span>
<div id="acme-extended-description" class="meta-options">
<label for="acme-extended-description-field">
Extended Description
</label>
<textarea name="acme-extended-description-field" id="acme-extended-description-field">
<?php get_post_meta( $post->ID, 'acme_extended_description_field', true ); ?>
</textarea>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment