Skip to content

niaeashes/paper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

paper

Install

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

Create custom post type

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.

Add theme supports

Post thumbnails and Custom image size

Paper_Initializer::instance()
	->support_post_thumbnails()
	->add_image_size( 'custom-size', 800, 600, true );

Add wordpress menu

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.");

Google Map

(new Paper_Map('chiyo'))
  ->title('千代パピヨンデイサービス')
  ->latlng(33.628112, 130.427415);

Constant for Theme

Define the constant in functions.php or another place.

Paper::constant('copyright', "niaeashes");

Show the constant.

&copy; <?php echo Paper::constant('copyright') ?>

Output.

&copy; <span class="paper-constant">niaeashes</span>

About

WordPress extending module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages