Giter VIP home page Giter VIP logo

child-pages-shortcode's Introduction

=== Child Pages Shortcode ===
Contributors: miyauchi - forked by Matthieu Brunet
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FR7RD5SGEU69Y
Tags: shortcode
Requires at least: 3.4
Tested up to: 3.7
Stable tag: 1.0.0

You can use shortcode for display child pages from the page.

== Description ==

You can use shortcode for display child pages from the page.

[This plugin maintained on GitHub.](https://github.com/miya0001/child-pages-shortcode)

= Some features =

* This plugin will add shortcode `[child_pages]` display child pages.
* You can customize default HTML template on your plugin.
* This plugin will be able to "excerpt" to the pages.

The fork add the following features :
* class parameter to specify the main div class
* template_file to specify a particular template file
* new %post_content% replacement tag to display the full content instead of the excerpt
* add the childPages function to be used as the template tag

= Example =

Display child pages of the current page.
`[child_pages width="33%"]`
Template tag :
childPages(array("id"=>3, "size"=>"25%", "width"=>"thumbs", "class"=>"my-child-page-class", "template_file"=>"my_template_file.php");


= Args =

* id - ID of page (Optional)
* size - Post thumbnail size. e.g. 'thumbnail' or 'large'
* width - width of block for child pages.
* disable_shortcode - Shortcode not work in the template if set true.
* disable_excerpt_filters - filters not work for the excerpt if set true.
* class - specify the class of the parent div
* template_file - specify a template file located in the theme directory

= filter hooks example =

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 variables

* %post_id% - ID of the Page
* %width% - Width of block for single page
* %post_url% - Page permalink
* %post_thumb% - <img> for Post thubmail
* %post_title% - Page title
* %post_excerpt% - Page excerpt
* %post_content% - Page content


= Contributors =

* [Takayuki Miyauchi](http://wpist.me/)
* [Matthieu Brunet](http://www.brunet.fr)

== Installation ==

* A plug-in installation screen is displayed on the WordPress admin panel.
* It installs it in `wp-content/plugins`.
* The plug-in is made effective.

== Changelog ==

1.0.0 first version of the fork

child-pages-shortcode's People

Contributors

miya0001 avatar matthieubrunet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.