WP でテーマをパッケージ化する方法はありますか? テーマとは、HTML、CSS、JS、カスタム投稿タイプなどすべてを意味します。
これらは、WP テーマを販売している ThemeForest などのサイトでよく見かけます。既に HTML/CSS/etc に変換されている私のデザインについても同じことをしたいと思います。
専門用語がよくわからないので、何を調べればいいのかわかりません。
WP でテーマをパッケージ化する方法はありますか? テーマとは、HTML、CSS、JS、カスタム投稿タイプなどすべてを意味します。
これらは、WP テーマを販売している ThemeForest などのサイトでよく見かけます。既に HTML/CSS/etc に変換されている私のデザインについても同じことをしたいと思います。
専門用語がよくわからないので、何を調べればいいのかわかりません。
ファイル構造はプロジェクトの範囲に応じて変化しますが、WordPressテーマを展開用にパッケージ化するために従うことができる業界のベストプラクティスがいくつかあります。
Envatoは、提出ガイドラインに関する広範なドキュメントを提供し、かなり包括的な方法でフォーマット標準に対応しています。ここにあります:http ://support.envato.com/index.php?/ Knowledgebase / Article / View / 352/0 / general-file-preparation-guidelines
ThemeforestのJeffreyWayは、優れたリファレンスとして役立つThemeforestテンプレートのファイル準備と送信プロセスのステップバイステップのビデオスクリーンキャストウォークスルーも提供しています。ここで見つかりました:http://blog.themeforest.net/site-news/how-to-submit-a-template-to-themeforest-screencast/
お役に立てれば。
既存のCSSをWordPressテーマに変換するために使用するWordPressボイラープレートを作成しました...
既存の HTML/CSS Web サイトを WordPress テーマに変換する場合は、いくつかのことを行う必要があります。
1.スタイルシートの名前を style.css に変更し、テーマに関するメタデータを少し含めます。
Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 default theme for WordPress.
Author: wordpressdotorg
Author URI: http://wordpress.org/
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
License URI:
General comments (optional).
ソース: http://codex.wordpress.org/Theme_Development#Theme_Stylesheet
また、ここで見つけることができる WordPress CSS コアを含める必要があります: http://codex.wordpress.org/CSS#WordPress_Generated_Classes
2.「最後の手段」として使用される index.php ファイルを作成します。現在のページに特定のページが見つからない場合は、このテンプレートが使用されます。ここで見つけることができるさまざまなテンプレートの詳細: http://codex.wordpress.org/Template_Hierarchy
単一のページに別のスタイルが必要な場合はsingle.php
、それらのページに使用されるファイルを作成する必要があります。ブログ投稿のあるページの場合はhome.php
、... を使用します。その他のファイル名については、上記のリンクを参照してください。
3.コンテンツをファイルに直接配置するのではなく、WordPress を使用する場合は明らかに望ましくありませんが、「ループ」を使用する必要があります。詳細については、http: //codex.wordpress.org/The_Loopをご覧ください。
基本的に、これはページのすべての異なる投稿をループする繰り返しです (カテゴリ ページとブログのホームページには、1 つのページよりも多くの投稿があります)。
次のコードは、「The Loop」を理解するのに大いに役立ちました。
<?php // any code included here occurs before the WordPress loop and is always displayed? >
<?php if (have_posts()) : ?>
<?php // if there are posts to display, process any code included here only once ?>
<?php // display any code output from this region above the entire set of posts ?>
<?php while (have_posts()) : the_post(); ?>
<?php // loop through posts and process each according to the code specified here ?>
<?php // process any code included in this region before the content of each post ?>
<?php the_content(); ?> <?php // this function displays the content of each post ? >
<?php // process any code included in this region after the content of each post ? >
<?php endwhile; ?>
<?php // stop the post loop and process any code included here only once ?>
<?php // any code output will be displayed below the entire set of posts ?>
<?php else : ?>
<?php // if there are no posts to display, process any code that is included here ?>
<?php // the output of any code included here will be displayed instead of posts ?>
<?php endif; ?>
<?php // any code included here occurs after the WordPress loop and is always displayed ?>
ソース: http://perishablepress.com/easily-adaptable-wordpress-loop-templates/
WordPress のテーマ設定は 1 回の投稿で説明するのは非常に難しいので、皆さんが始めるのに役立つことを願っています.毎日参照...最後のリンク: http://codex.wordpress.org/Function_Reference/
幸運を!