[MovableType]カスタムフィールドのPDFへのリンク
カスタムフィールドのPDFへのリンク
<MTIf tag="CFEntryDataPdf"> <MTCFEntryDataPdfAsset> <a href="<MTAssetURL>" target="_blank">donwload pdf</a> </MTCFEntryDataPdfAsset> </MTIf>
カスタムフィールドのPDFへのリンク
<MTIf tag="CFEntryDataPdf"> <MTCFEntryDataPdfAsset> <a href="<MTAssetURL>" target="_blank">donwload pdf</a> </MTCFEntryDataPdfAsset> </MTIf>
プラグイン「PageBute」でページネーションテンプレ
<MTIgnore>1ページに表示する記事数</MTIgnore> <MTSetVar name="per_page" value="12"> <mt:Entries lastn="0" sort_by="authored_on" sort_order="descend"> <mt:EntriesCount setvar="entries_count"/> </mt:Entries> <mt:If name="entries_count" gt="$per_page"> <ul> <MTPagination> <MTPaginationHeader> <MTIfPaginationFirst> <li class="prev"><a href="<MTPaginationPrev regex_replace="/index\.html$/","">">前へ</a></li> <MTElse> <MTignore>最初のページの時</MTignore> <li class="prev"><span>前へ</span></li> </MTIfPaginationFirst> </MTPaginationHeader> <MTIfPaginationCurrent> <MTignore>現在のページ</MTignore> <li class="is_active"><MTPaginationLink element="number"></li> <MTElse> <MTignore>それ以外(遷移用のリンクあり)</MTignore> <li><a href="<MTPaginationLink regex_replace="/index\.html$/","">"><MTPaginationLink element="number"></a></li> </MTIfPaginationCurrent> <MTPaginationFooter> <MTIfPaginationLast> <li class="next"><a href="<MTPaginationNext>">次へ</a></li> <MTElse> <MTignore>最後のページの時</MTignore> <li class="next"><span>次へ</span></li> </MTIfPaginationLast> </MTPaginationFooter> </MTPagination> </ul> </mt:If>
文字列分割プラグイン「Split」
<MTSetVarBlock name="blog_path"><MTCanonicalURL with_index="1"></MTSetVarBlock> <MTIgnore>プラグイン「Split」の機能</MTIgnore> <MTVar name="blog_path" split="/" setvar="bp_parts"> <MTSetVarBlock name="filename"><MTVar name="pop(bp_parts)"></MTSetVarBlock>
ページ分割プラグイン「PageBute」
http://www.mtcms.jp/movabletype-blog/plugins/pagebute/
<MTIgnore>1ページに表示する記事数</MTIgnore> <MTSetVar name="per_page" value="6"> <MTIgnore>プラグイン「PageBute」の機能</MTIgnore> <MTPageContents count="$per_page"> <MTEntries sort_by="authored_on" sort_order="descend"> <p><MTEntryTitle trim_to="30+..." encode_html="1"></p> <MTPageSeparator> </MTEntries> </MTPageContents>
ざっくりテンプレ
index.php
<!DOCTYPE html> <html lang="ja"> <?php get_header('Meta'); ?> <body> <?php get_header('Top'); ?> <div id="main" class="clearfix"> <?php get_sidebar('L'); ?> <div id="content"> <h2> <?php if( is_single() ){/* 個別記事 */ the_title(); }else if( is_page() ){/* 個別ページ */ the_title(); }else if( is_category() ){/* カテゴリーアーカイブ */ echo 'category : '; echo get_cat_name( wp_specialchars($cat,1) ); }else if( is_search() ){/* 検索結果 */ echo 'search : ' . wp_specialchars($s, 1); }else if( is_archive() ){/* アーカイブ */ echo 'archive : ' . wp_specialchars($m, 1); }else{ echo 'Home'; } ?> </h2> <?php if( is_page() ): ?> <?php if(have_posts()):the_post(); ?> <?php if( get_post_status()!='private' && get_post_status()!='pending' ): ?> <?php get_template_part("original-page-$page_id"); ?> <?php endif; ?> <?php endif; ?> <?php else: ?> <?php if(have_posts()):while(have_posts()):the_post(); ?> <?php if( get_post_status()!='private' && get_post_status()!='pending' && !is_page() ): ?> <article> <div class="article-inner link-dotted word-break"> <div class="article-header"> <a href="<?php the_permalink(); ?>"> <strong><?php the_title(); ?></strong> </a> <small class="article-time"><?php the_time('Y年n月j日'); ?></small> </div> <div class="article-text"> <?php the_content(); ?> </div> <div class="article-footer clearfix"> <?php get_template_part('footer-article'); ?> </div><!--article-footer--> </div><!--article-inner--> </article> <?php endif; ?> <?php endwhile;?> <?php else: ?> <article> <div class="article-inner link-dotted word-break"> <div class="article-header"> <img class="article-image" src="<?php echo get_template_directory_uri().'/icon/icon-404.png' ?>"/> <strong> <?php if (!have_posts() ): ?> [Not Found]見つかりませんでした。 <?php endif; ?> </strong> <small class="article-time"><?php echo date('Y年m月d日'); ?></small> </div> <div class="article-text"> [Not Found]見つかりませんでした。 </div> <div class="article-footer clearfix"> </div><!--article-footer--> </div><!--article-inner--> </article> <?php endif; ?> <?php endif; ?> </div><!--content--> <?php get_sidebar('R'); ?> </div><!--main--> <?php get_footer(); ?> </body> </html>
header-Meta.php
<head> <meta charset="UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <meta name="author" content="ktyr report" /> <meta name="copyright" content="ktyr report" /> <meta name="keywords" content=""> <meta name="description" content=""> <link href="<?php echo get_stylesheet_directory_uri(); ?>/icon/favicon.ico?t=2" type="image/x-icon" rel="icon" /> <link href="<?php echo get_stylesheet_directory_uri(); ?>/icon/favicon.ico?t=2" type="image/x-icon" rel="shortcut icon" /> <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/common/css/common.css" media="screen" /> <script type="text/javascript" src="<?php echo get_stylesheet_directory_uri().'/common/js/jquery-2.0.3.min.js'; ?>"></script> </head>
header-Top.php
<header> <div class="header-inner"> <div class="header-inner-inner"> <h1 id="blog-name"><a href="<?=home_url()?>">wp template</a></h1> </div> </div> </header>
sidebar-L.php
<div id="sidebarL"> <section class="relative"> <form class="mb-14" role="search" method="get" id="searchform" action="<?=home_url()?>" > <input type="search" class="" id="s" name="s" placeholder="Search"> <span class="search-icon"> <button type="submit"> <span class="hidden">検索</span> </button> </span> </form> </section> <section> <select class="w-sidebarL" name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value="">archives</option> <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select> </section> </div>
sidebar-R.php
<div id="sidebarR"> <div class="roundbox"> </div> </div>
footer.php
<footer> <div class="footer-inner">powered by <a href="http://wordpress.org/" target="_blank">WordPress</a></div> </footer>
footer-article.php
<input type="text" value="<?php the_permalink(); ?>" readonly>
original-page-2.php
オリジナルページ2
本文のpタグ削除。でも改行はさせる。
<MTEntryBody regex_replace="/<br />/g","<br />\n" regex_replace="/<p>|</p>/g","" nl2br="xhtml">