{"id":35898,"date":"2011-10-11T08:00:00","date_gmt":"2011-10-11T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/child-pages-shortcode\/"},"modified":"2015-04-26T21:01:00","modified_gmt":"2015-04-26T21:01:00","slug":"child-pages-shortcode","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/child-pages-shortcode\/","title":{"rendered":"Child Pages Shortcode"},"content":{"rendered":"<p>You can use shortcode for display child pages from the page.<\/p>\n<p><a href=\"https:\/\/github.com\/miya0001\/child-pages-shortcode\" rel=\"nofollow ugc\">This plugin maintained on GitHub.<\/a><\/p>\n<h4>Some features<\/h4>\n<ul>\n<li>This plugin will add shortcode <code>[child_pages]<\/code> display child pages.<\/li>\n<li>You can customize default HTML template on your plugin.<\/li>\n<li>This plugin will be able to \u201cexcerpt\u201d to the pages.<\/li>\n<\/ul>\n<h4>Example<\/h4>\n<p>Display child pages of the current page.<br \/>\n    [child_pages width=\u201d33%\u201d]<\/p>\n<h4>Args<\/h4>\n<ul>\n<li>id \u2013 ID of page (Optional)<\/li>\n<li>size \u2013 Post thumbnail size. e.g. \u2018thumbnail\u2019 or \u2018large\u2019<\/li>\n<li>width \u2013 width of block for child pages.<\/li>\n<li>disable_shortcode \u2013 Shortcode not work in the template if set true.<\/li>\n<li>disable_excerpt_filters \u2013 filters not work for the excerpt if set true.<\/li>\n<\/ul>\n<h4>filter hooks example<\/h4>\n<p>Filter for query_posts() query.<\/p>\n<pre><code><?php\n    \/\/ default args\n    $args = array(\n        'post_status' => 'publish',\n        'post_type' => 'page',\n        'post_parent' => $id_for_the_post,\n        'orderby' => 'menu_order',\n        'order' => 'ASC',\n        'nopaging' => true,\n    );\n\n    add_filters('child-pages-shortcode-query', \"my_query\");\n    function my_query($args) {\n        \/\/\n        \/\/ some code here\n        \/\/\n        return $args;\n    }\n?>\n<\/code><\/pre>\n<p>Filter for default template.<\/p>\n<pre><code><?php\n    add_filter(\"child-pages-shortcode-template\", \"my_template\");\n    function my_template($template) {\n        return '<div class=\"%class%\"><a href=\"%post_url%\">%post_thumb%<\/a><\/div>';\n    }\n?>\n<\/code><\/pre>\n<p>Filter for stylesheet URI.<\/p>\n<pre><code><?php\n    add_filter(\"child-pages-shortcode-stylesheet\", \"my_style\");\n    function my_style($url) {\n        return 'http:\/\/example.com\/path\/to\/style.css';\n    }\n?>\n<\/code><\/pre>\n<p>Default Template<\/p>\n<pre><code><div id=\"child_page-%post_id%\" class=\"child_page\" style=\"width:%width%;\">\n    <div class=\"child_page-container\">\n        <div class=\"post_thumb\"><a href=\"%post_url%\">%post_thumb%<\/a><\/div>\n        <div class=\"post_content\">\n            <h4><a href=\"%post_url%\">%post_title%<\/a><\/h4>\n            <div class=\"post_excerpt\">%post_excerpt%<\/div>\n        <\/div>\n    <\/div>\n<\/div>\n<\/code><\/pre>\n<p>Template valiables<\/p>\n<ul>\n<li>%post_id% \u2013 ID of the Page<\/li>\n<li>%width% \u2013 Width of block for single page<\/li>\n<li>%post_url% \u2013 Page permalink<\/li>\n<li>%post_thumb% \u2013  for Post thubmail<\/li>\n<li>%post_title% \u2013 Page title<\/li>\n<li>%post_excerpt% \u2013 Page excerpt<\/li>\n<\/ul>\n<h4>Support<\/h4>\n<ul>\n<li>http:\/\/wpist.me\/wp\/child-pages-shortcode\/ (en)<\/li>\n<li>http:\/\/firegoby.theta.ne.jp\/wp\/child-pages-shortcode (ja)<\/li>\n<\/ul>\n<h4>Contributors<\/h4>\n<ul>\n<li><a href=\"http:\/\/wpist.me\/\" rel=\"nofollow ugc\">Takayuki Miyauchi<\/a><\/li>\n<\/ul>\n<h3>Credits<\/h3>\n<p>This plug-in is not guaranteed though the user of WordPress can freely use this plug-in free of charge regardless of the purpose.<br \/>\nThe author must acknowledge the thing that the operation guarantee and the support in this plug-in use are not done at all beforehand.<\/p>\n<h3>Contact<\/h3>\n<ul>\n<li>http:\/\/wpist.me\/<\/li>\n<li><a href=\"https:\/\/twitter.com\/#!\/wpist_me\" rel=\"nofollow ugc\">@wpist_me<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>You can use shortcode for display child pages from the page.<\/p>\n","protected":false},"author":65,"featured_media":251736,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Child Pages Shortcode - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"You can use shortcode for display child pages from the page."},"footnotes":""},"categories":[1],"tags":[345],"class_list":["post-35898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-shortcode"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/35898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=35898"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/35898\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/251736"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=35898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=35898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=35898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}