Skip to main content

Home/ WordPress Beginners/ Group items tagged template

Rss Feed Group items tagged

Toshiro Shimura

[WP]テンプレートファイルの仕様と構成 - WebTecNote - 0 views

  • Wordpressのデザインはテーマと呼ばれてます。テーマを構成するファイル群がテンプレートファイルです。 他のブログのようにテーマをテンプレートと呼んでも通じるけど、検索するときはテーマ(Theme)を使う方が良いかも。 ダウンロードしたばかりだと"Classic" と "Default"の2つがプリインストールされてますが、 テーマ新しく追加する場合は、ダウンロードして解凍したテーマのフォルダをWordpressのwp-content/themes/にアップロードするだけ。 デザイン(表示)に並ぶテーマのスクリーンショットをクリックすれば即座に変更されます。 テーマ変更で再構築が必要ない、というのがWordpressの良いところ。 Wordpressは1.x系、2.0.x系、2.1.x系、2.2以降と2.5では内部仕様が違ってるので、テーマやプラグインはバージョンにあったものを選ばないとエラーが出たりするので注意。 特に2.5は最新とあって対応してるテーマやプラグインもまだ少ないようです。 公式のリスト» WordPress 2.5 Theme Compatibility List WordPress 2.5 Plugin Compatibility List
  • Wordpressはコアファイル・プラグイン等全てPHPなので、PHPとmySQLに通じていればかなり色々なことができます。 テーマを構成するテンプレートファイルは、XHTMLとPHPのテンプレートタグで作成されてます。 XHTMLとUTF-8で記述するのがベターですが、HTMLでも文字コードさえ合ってれば問題はないです。 文字コードはWordpress2.5ではUTF-8のみになりました。 テキストエディタはBOM無しのUTF-8で保存できるものを選ぶ必要があります。(メモ帳はダメ!絶対)
  • テンプレートに記述するWordpress独自のPHPコードはテンプレートタグの他、ループやファンクションなどかなり色々使えます。 PHPの関数や変数なんかも使えま
  • ...6 more annotations...
  • テンプレートファイル群の中に特別重要なものが2つあります。style.cssとfunctions.phpです。 style.cssにはただのphpファイルの集まりに過ぎないフォルダを、Wordpressにテーマと認識させる重要なコメントが入ります。 functions.phpはテーマで使う関数や初期設定、ウィジェットなどのソースコードが入ります。(無くても動きます) style.cssを開くと、冒頭にコメントが入ってます。 このコメントがないとテーマと認識されません。
  • 基本テンプレート一覧 style.css(必須) テーマのメインとなるスタイルシートファイル。上で書いたコメントが必要。@importで他のCSSを読み込む事が出来ます index.php メインテンプレート。カテゴリやページ、シングルページにそれぞれテンプレートファイルがある場合はそちらが優先して使用されます。最低これとcomments.phpがあれば動く。 comments.php コメントエリア表示用テンプレート。コメントフォームとコメントのリスト表示を担当します。Defaultのテンプレートを流用するのがベター。 comments-popup.php ポップアップのコメントエリア表示用テンプレート。Defaultのテンプレートを流用するのがベター。 headにcomments_popup_script();、ループ内にcomments_popup_link();があると表示される。 テーマ内にテンプレートが見つからない場合は、Deafaultのテンプレートが使用される。 home.php ホームページ用のテンプレート。固定ページに設定しない場合にこのテンプレートファイルがあると、トップだけこのテンプレートが使われます。 single.php 投稿記事用テンプレート。時事系列に沿わないページには適用されない。 page.php ページ用テンプレート。ページは1ページずつ独自のテンプレートを設定することも出来ますが、それが設定されてない場合に使用される。 paged.php archive.phpやsearch.phpで2ページ目以降がある場合に使われる。category.php・date.php・author.phpがある場合はそちらが優先されるので使用されない。 category.php カテゴリー用テンプレート。カテゴリー一覧を表示する際に使用される。 author.php 投稿者用テンプレート。投稿者情報を表示する際に使用される。 date.php 日時クエリで表示する際に使用されるテンプレート。アーカイブと似てる archive.php アーカイブ表示用テンプレート。表示優先順位はcategory.php、author.php、date.phpより下。 search.php 検索結果用テンプレート。無い場合はindex.phpが使われる。 404.php 404 Not Found用のテンプレート。無い場合はindex.php。 image.php 画像表示用テンプレート。[gallary]の画像ファイル単体表示(v2.5~) attachment.php 画像表示用テンプレート。「ページにリンク」を選択した時の画像表示用 tag.php タグ用テンプレート。タグのアーカイブ表示
  • パーツテンプレート 呼び出しタグが用意されているパーツテンプレートは次の通り。 header.php(get_header();) ヘッダ出力用のテンプレート。 footer.php(get_footer();) フッター出力用のテンプレート。 sidebar.php(get_sidebar();) サイドバー出力用のテンプレート 関数がなくてもincludeなどで取得して表示することが出来ます。
  • Page Templates ページには、各ページごとにそれぞれ独自のテンプレートを使うことが出来ます。 作成方法は、任意の名前.phpでファイルを作成して、冒頭に次のコメントを入れるだけ。
  • Category Templates カテゴリーを表示するテンプレートはいくつかあります。優先順位は次の通り。 category-6.php category.php archive.php index.php category-6.phpのように英数をつけたテンプレートを作ると、英数と同じIDのカテゴリーを表示するときだけ使用されます。
  • Author Templates 投稿者ページを表示するには、まず次のリンクをループ内に記述します。
anonymous

Powerful & Affordable WordPress Integration services - 0 views

  •  
    Make your online presence more effective with our powerful & affordable WordPress Integration services. We help integrate WP sites & blogs with themes, templates, ecommerce frameworks, forum software and lot more as per your business needs.
Siraj Mahmood

Top 10 Real Estate WordPress Themes - KnowledgeIDea - 0 views

  •  
    Top 10 real estate WordPress themes. Now buy and sell property is easy with real estate WordPress templates. WordPress best real estate themes collection.
Toshiro Shimura

10 Things You Need to Know About WordPress 2.6 - 1 views

  • Post Versioning Developers familiar with Subversion, or SVN, understand the concept of versioning and diffs. Compare one file, or revision, against another file, or revision, and see a breakdown of differences between the two. With the help of GUI tools, developers can see a color-coded red vs. green (removed vs. added) presentation. This concept has now been applied to posts so you can view differences between posts as well as “revert” to an earlier version of a post. I absolutely love this feature and you can see an example of a “revision compare” built directly into WordPress.
  • Google Gears Support Gears is the Google technology that allows for Firefox (apparently IE 6 too, but I can’t confirm) to “pre-cache” pages and speed up access. Gears has been integrated with WordPress 2.6 on the admin side and speeds things up tremendously. This is particularly important where broadband access is limited or inaccessible (third world, for instance). To enable Gears in your new WordPress 2.6 installation, click on the Turbo link in the upper right corner of your WordPress admin.
  • XML-RPC Editor Functionality Quietly, a new bit of functionality snuck into WordPress trunk that threw a number of developers and kicked off an interesting discussion. In the development cycle, XML-RPC and Atom Pub API for remote editing was turned off by default as a “security precaution” since many recent WordPress security issues seem to stem from the XML-RPC protocol.
  • ...7 more annotations...
  • SQL Security - $wpdb->prepare() Back in WordPress 2.3, the prepare() first emerged, initially unused… but there. The method was very experimental at the time and was not ready for prime-time so, though it was included, it was not yet used. We started to see its emergence in WordPress 2.5 and in WordPress 2.6 it is being used just about everywhere.
  • Shift-Click Selection of Multiple Checkboxes in WP-Admin As the backend of WordPress continues to evolve after the release of the drastically redesigned admin in WP 2.5, usability enhancements are also making their way in.
  • More Avatar Options With the Automattic acquisition of Gravatar last year, in-built support for Gravatars was introduced in WordPress 2.5. WordPress 2.6 gives the blogger more options by allowing for selection of the “default” avatar. Out of the box, the default Gravatar can be “Mystery Man”, a generic grey avatar with a white silhouette of someone. Default avatars can also be “blank” (self-explanatory), the Gravatar logo, Identicons, Wavatars or MonsterIDs. These have all been a part of WordPress.com for some time and now come to the rest of us. For more information, Matt wrote a post for the WP.com community that you should probably check out. The difference here being, of course, that WordPress.com offers “dashboard avatars” and WPFROU (WordPress for the Rest of Us) does not include this functionality.
  • Page Templates over XML-RPC In addition to the XML-RPC/APP security measures listed above, a new key bit of functionality has now been exposed for API editors (and also, if you think about it, demonstrates the power behind XML-RPC and why you might want to turn it off if you don’t use it). The XML-RPC interface now allows for managing page templates from an API editor. To the best of my knowledge, no editor supports this yet and may not. However, increasingly there is the ability to remotely post content from places like YouTube, Utterz and others. None of these services would have any real use for this functionality either, however I want to point out that because they can post remotely anything that is exposed to the remote world can also be managed.
  • Press This Press this! is a new enhancement of a long-existing concept. Bookmarklets. In fact, WordPress used to have a bookmarklet included that would allow a user to quickly start a new post from the browser toolbar, but the functionality was limited.
  • Integrated Theme Preview Theme previewing has been a bugaboo for many a theme designer. How do we check and develop without affecting the rest of the site. Some folks resorted to using Ryan’s venerable Theme Preview plugin. Others setup a beta version of a site that was sandboxed off from the rest of the world. Lots of different approaches, all of which remain valid.
  • Plugin Management Overhaul Finally, the plugin management interface has received a face-lift and some added functionality. Active plugins and inactive plugins are segregated and with that new fangled Shift-click functionality I talked about before, plugin management just got really freaking simple. Note that Active plugins can be deactivated in bulk and Deactivated plugins can be activated or even deleted in bulk. Clean up that stale plugin list in a snap. But… there’s always a but… make a backup before you go nuts.
designsave

Monstroid Star Wars Styled WordPress Theme - Designsave.com - 0 views

  •  
    Monstroid is a large parent WordPress theme that includes all the functionality that a true multi-purpose website template should boast.
Clara James

Web Development and Design Outsourcing - 0 views

  •  
    Virtual Force a web design and WordPress Development Company offers custom web designing services for our valued clients. Virtual Force offers the very best services in web development and WordPress plugin development. Our web design services are tailored made for your satisfaction.
mesbah095

Guest Post Online - 0 views

  •  
    Article Writing & Guestpost You Can Join this Site for Your Article & guest post, Just Easy way to join this site & total free Article site. This site article post to totally free Way. Guest Post & Article Post live to Life time only for Current & this time new User. http://guestpostonline.com
chimpdesign

Best Directory WordPress Theme for Business Listing, job portal and Classifieds Ads - 0 views

  •  
    Do you have a plan to build an online directory? Then the best platform for your project is WordPress. I have couple of examples for directory demonstration to prove WordPress is the best, because it offers themes with multiples features which are you directory listing website requirement.
chimpdesign

Directory | Multi-purpose WordPress Theme - 0 views

  •  
    Directory the Multi-purpose WordPress Theme is an absolutely unique premium WordPress theme, it is the result of our hardworking development team and constant feedbacks from users and buyers. This theme is built in cooperation with you! Your users will never have access to the WordPress dashboard, everything is done at front-end.
  •  
    Directory the Multi-purpose WordPress Theme is an absolutely unique premium WordPress theme, it is the result of our hardworking development team and constant feedbacks from users and buyers. This theme is built in cooperation with you! Your users will never have access to the WordPress dashboard, everything is done at front-end.
chimpdesign

Luxury | Online Hotel Booking Reservation Theme - 0 views

  •  
    Luxury is the online hotel booking and reservation WordPress theme specially design for hotel booking, room reservation and resort booking. The theme come with advance room booking system, its stunning features allow user to check all available rooms. User can also change the parameters of the room selection in the middle of the booking with its awesome ajax features.
chimpdesign

Directory | Multi-purpose WordPress Theme - 0 views

  •  
    Directory the Multi-purpose WordPress Theme is an absolutely unique premium WordPress theme, it is the result of our hardworking development team and constant feedbacks from users and buyers. This theme is built in cooperation with you! Your users will never have access to the WordPress dashboard, everything is done at front-end.
chimpdesign

PeachClub | Kindergarten ChildCare WordPress Theme - 0 views

  •  
    PeachClub is a Child education responsive WordPress Theme best suitable for kindergarten, child care center, preschool or nursery, school, child school, daycares, preschools and other small businesses like children, art, craft or creative website. The theme is compatible with all browsers and is fully responsive. The Theme comes with one click Theme Demo Data Installer.
Toshiro Shimura

DBS>Interactive | WordPress Function List - 0 views

  • The content was reformatted for quick reference from the Template Tag section of the WordPress.org Codex, a relative encyclopedia to WordPress theming, and great reference for your WordPress questions.
Toshiro Shimura

[WP]Wordpress オプションページの作成 - WebTecNote - 0 views

  • どうしても作りたいプラグインが出来たので試しに作ってみてるが、その際避けて通れないオプション設定ページ。 テーマの独自設定を作りたい時にも使える。 Creating Options Pagesから適当に抜粋。 ページそのものの追加は前のエントリーで紹介してるので省略。 最後の方に設定保存のメカニズムについても適当に解説をつけてみた。
  • WordpressはデータベースのOptionsテーブルを使って設定を保存します。 オプションとして保存出来る値は、文字・配列・PHPオブジェクトである。 他のプラグインと衝突しないために、オプション名は独自性のある文字列でなければならない。 phpmyadminか何かで、Optionsテーブルのoption_nameやoption_valueを見るとプラグインの設定が保存されてるのが確認出来ます。 メイン関数。この関数を使うとOptionsにアクセスできる。
Toshiro Shimura

[WP]管理ページに任意のメニューとページを追加する - WebTecNote - 0 views

  • デフォルトテーマはヘッダのグラデーションがテーマ内のタブから変更出来るようになってます。 管理ページのメニューやページの追加も、テーマのfunction.phpから可能です。
  • add_menu_page(ページタイトル, メニューのタイトル,表示するユーザレベルまたは能力, ファイル名, 実行する関数名); add_theme_pageも同じ。 他には、add_options_page、add_management_page、add_submenu_pageなどがある。 表示するユーザレベルまたは能力については、ユーザレベル(0~10)か管理能力名(edit_themes等)で指定。 Docs:Adding Administration Menus basename(__FILE__)だとfunctions.phpがページのURLになるので、2つ3つ追加する場合は名前を指定する。 インクルードも使える。
Toshiro Shimura

[WP]投稿ページにオプションエリアを追加する - WebTecNote - 0 views

  • タグとかカテゴリーみたいなクリックで開閉するオプションエリアを追加する方法について。 ページと同じくこれもテーマのfunction.phpで可能です。プラグインで作っても良い。
  • edit_form_advancedで記事投稿、edit_page_formでページ作成のとき表示される。 postbox_classes($id,$page)はwp-admin/includes/post.phpの587行目あたりにある関数。 タブの初期開閉状態を操作するクラスを追加する。
Toshiro Shimura

[WP]Wordpress2.5 フルサイズの横幅を500px以上にする - WebTecNote - 0 views

  • Wordpress2.5のメディアアップロードでは画像のサムネイルサイズに小・中と2種類増えたことで、 フルサイズを含めて3種類になったわけだが、フルサイズで画像を投稿に挿入したとき何もしてないと 横幅の最大が500pxで固定されてしまうことがある。 500px以上にしたい場合は、アクティブなテーマのfunction.phpに次のコードを記述する。
Toshiro Shimura

[WP]Wordpressテンプレートカスタマイズ用小技メモ - WebTecNote - 0 views

  • テンプレートファイルのカスタマイズで使えそうなソースのサンプルをつらつらと書き散らしてみる。 タイトルの文字数制限 一定数以上のタイトルを省略(抜粋)する。 下記サンプルだと10文字まで拾って以下を三点リーダにしています
Toshiro Shimura

ウィジェットの領域を増やして広告スペースを作る | ハウスウエディング - 0 views

  • なみに当ブログでは 右サイドバーにウィジェット領域が2つ用意されているテーマです。 もともとの構図は以下 ヘッダー 記事 サイドバー1(ウィジェット) サイドバー2(ウィジェット) フッター これを ヘッダー 自由スペース(ウィジェット3) 記事 サイドバー左(ウィジェット1) サイドバー右(ウィジェット2) フッター このように変更してみる
  • 当ブログでは 右サイドバーにウィジェット領域が2つ用意されているテーマです。 もともとの構図は以下 ヘッダー 記事 サイドバー1(ウィジェット) サイドバー2(ウィジェット) フッター これを ヘッダー 自由スペース(ウィジェット3) 記事 サイドバー左(ウィジェット1) サイドバー右(ウィジェット2) フッター このように変更してみる
Toshiro Shimura

ウィジェット領域を2つ以上つくる | WordPressカスタマイズメモ【企業ホームページ制作方法】 - 0 views

  • WordPressのウィジェット領域は、標準ではsidebar.php内の1カ所だけだが、index.phpやfooter.phpなど、その他のエリアにもウィジェット領域を持たせる。
  • ■手順1:テーマフォルダ/functions.php 3行目register_sidebar(array(これをregister_sidebars(3,array(※数字は、ウィジェット領域の数
  • ■手順2:(例:index.phpのループの前と後に2つの領域を挿入)テーマフォルダ/index.php 5行目 have_postsの前に以下を挿入<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>ここはウィジェット「2」※ウィジェットに何も登録されていない時にここの内容を表示<?php endif; ?>テーマフォルダ/index.php 40行目 endifの後に以下を挿入<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>ここはウィジェット「3」※ウィジェットに何も登録されていない時にここの内容を表示<?php endif; ?>※分かりやすくするためにdivで囲って色を付けてあります。※サイドバーには、ウィジェットが登録されていない場合は従来どおりの標準的な内容が表示されます。
  • ...2 more annotations...
  • ■手順3:ウィジェットを追加管理画面>Design>Widgetにて、右側「Current Widget」のプルダウンメニューにウィジェット領域が3つ出来たことを確認し、それぞれの領域にウィジェットを設定する。左側に並んでいるウィジェットの「Add」ボタンを押すと右側に追加されるので、上下の順番をドラッグ&ドロップで変えて「Save Changes」をクリック。■結果:ループの前と後、右サイドバーそれぞれに別々のウィジェット領域が追加されました。標準のウィジェット類やアフィリエイトのバナー(テキストウィジェット)の他、PHPを実行可能なウィジェットも追加すれば、使い方次第でかなり凝った複雑なサイトでもすごく簡単にレイアウト変更ができるようになります、クライアント側でも。
  • ■補足:テーマフォルダ/functions.php 4~7行目に、それぞれのウィジェットの前後に挿入されるタグ類を指定する「before_widget」「after_widget」「before_title」「after_title」という項目があります。標準ではそれぞれli、h2となっています。上記テストではそこはいじってないです。
1 - 20 of 25 Next ›
Showing 20 items per page