Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Created January 8, 2016 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfmeier/e34fb0c8e4c012d09b50 to your computer and use it in GitHub Desktop.
Save rfmeier/e34fb0c8e4c012d09b50 to your computer and use it in GitHub Desktop.
Display the custom meta box content with the post type 'testimony' archive settings
<?php
/**
* Display the custom meta box content with the post type 'testimony' archive settings.
*/
/**
* Callback for WordPress add_meta_box() function parameter.
*
* Display the custom meta box content with the post type 'testimony' archive settings.
*
* @see https://codex.wordpress.org/Function_Reference/add_meta_box
*
* @since 0.0.1
*
* @return void
*/
function cpt_as_display_archive_settings_posts_per_page_box() {
$posts_per_page = genesis_get_cpt_option( 'posts_per_page', 'testimony' );
?>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<label for="<?php echo cpt_as_testimony_get_field_id( 'posts_per_page' ); ?>"><b><?php esc_html_e( 'Posts per page.', 'genesis-custom-post-type-archive-sample' ); ?></b></label>
</th>
<td>
<p><input class="small-text" type="text" name="<?php echo cpt_as_testimony_get_field_name( 'posts_per_page' ); ?>" id="<?php echo cpt_as_testimony_get_field_id( 'posts_per_page' ); ?>" value="<?php echo esc_attr( $posts_per_page ); ?>" /></p>
</td>
</tr>
</tbody>
</table>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment