Include your theme.
cd wp-content/themes/your_theme
git clone https://github.com/niaeashes/paper.git modules
echo 'require get_template_directory() . "/modules/include.php";' >> functions.php
Include your wordpress.
cd wp-content
git clone https://github.com/niaeashes/paper.git modules
echo 'require WP_CONTENT_DIR . "/modules/include.php";' >> themes/your_theme/functions.php
Define custom post type using method chain.
require get_template_directory() . "/modules/include.php";
(new Paper_Post_Type('custom'))
->support_thumbnail()
->support_custom_field();
Note: 'title' and 'editor' is default supported.
Paper_Initializer::instance()
->support_post_thumbnails()
->add_image_size( 'custom-size', 800, 600, true );
Define menu location.
new Paper_Menu( 'theme-location' );
Show the menu in template file.
<?php echo Paper_Menu::instance( 'theme-location' ) ?>
Another methods.
Paper_Menu::exists('theme-location'); // return true when 'theme-location' menu is defined, but false in not defined.
Paper_Menu::instance('theme-location')->has_menu(); // return true when menu is defined on administrator screen.
Paper_Menu::instance('theme-location')
->description("Write menu description for Administrator page.");
(new Paper_Map('chiyo'))
->title('千代パピヨンデイサービス')
->latlng(33.628112, 130.427415);
Define the constant in functions.php or another place.
Paper::constant('copyright', "niaeashes");
Show the constant.
© <?php echo Paper::constant('copyright') ?>
Output.
© <span class="paper-constant">niaeashes</span>