Child Pages Shortcode

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

Some Feture

  • This plugin will add shortcode [child_pages] for display child pages.
  • You can customize default HTML template & Stylesheet from your plugin.
  • This plugin will be able to “excerpt” to the pages.

Excerpt support on the Page

Shortcode sample

Dsiplaying child pages from the Page

You can customize html output and stylesheet

filter hook for 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>';
    }
?>
  • %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

filter hook for stylesheet

<?php
    add_filter("child-pages-shortcode-stylesheet", "my_style");
    function my_style($url) {
        return 'http://example.com/path/to/style.css';
    }
?>

Default source of 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>

Change log

Child Pages Shortcode | wpist

Donate

It is hard to continue development and support for WordPress plugins without contributions from users like you.

14 thoughts on “Child Pages Shortcode

  1. Hey,
    I have an issue with wordpress 3.5.1 where the “read more” does not link to the child post. It links to the parent. I have tried to edit the plugin to work but have not been able to get it working.

  2. Hey,
    On wordpress 3.5.1 the “Continue Reading” does not like to the child theme but instead is linked to the parent page. I have tried to change this but nothing worked. Hope for an easy fix soon.

  3. Is it possible to remove the excerpts? I’m looking to just have the image and a title. Any help would be appreciated! :)

  4. Hi, I really like this plugin! I have a request, just in case you’d be willing to add something simple:
    Would it be possible to add an anchor to each child page display box? That way on the page showing the child pages it will be easy to link within that page.
    Something like this:

    private function get_template()
    {
    $html = “\n”;
    $html .= ‘‘;
    $html .= ”;
    …….
    …….
    …….
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s