>
Download This Plugin | |
Download Elegant Themes | |
Name | Child Pages Shortcode |
Version | 1.9.2 |
Author | Takayuki Miyauchi |
Rating | 94 |
Last updated | 2015-01-19 04:14:00 |
Downloads |
50273
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Child Pages Shortcode plugin added 2 kB of resources to the Home page and 2 kB of resources to the sample Post page.
Child Pages Shortcode plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Child Pages Shortcode plugin ads no tables to your Wordpress blog database.You can use shortcode for display child pages from the page.
This plugin maintained on GitHub.
[child_pages]
display child pages.Display child pages of the current page.
[child_pages width="33%"]
Filter for query_posts() query.
<?php
// default args
$args = array(
'post_status' => 'publish',
'post_type' => 'page',
'post_parent' => $id_for_the_post,
'orderby' => 'menu_order',
'order' => 'ASC',
'nopaging' => true,
);
add_filters('child-pages-shortcode-query', "my_query");
function my_query($args) {
//
// some code here
//
return $args;
}
?>
Filter for default template.
<?php
add_filter("child-pages-shortcode-template", "my_template");
function my_template($template) {
return '<div class="%class%"><a href="%post_url%">%post_thumb%</a></div>';
}
?>
Filter for stylesheet URI.
<?php
add_filter("child-pages-shortcode-stylesheet", "my_style");
function my_style($url) {
return 'http://example.com/path/to/style.css';
}
?>
Default Template
<div id="child_page-%post_id%" class="child_page" style="width:%width%;">
<div class="child_page-container">
<div class="post_thumb"><a href="%post_url%">%post_thumb%</a></div>
<div class="post_content">
<h4><a href="%post_url%">%post_title%</a></h4>
<div class="post_excerpt">%post_excerpt%</div>
</div>
</div>
</div>
Template valiables