Descrição
Você pode usar um shortcode para exibir as páginas descendentes de uma página.
Este plugin é mantido no GitHub.
Alguns recursos
- 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.
Exemplo
Display child pages of the current page.
[child_pages width=”33%”]
Argumentos
- id – ID da página (opcional)
- tamanho – Tamanho da miniatura do post. ex: ‘thumbnail’ ou ‘large’
- largura – largura do bloco para páginas individuais.
- disable_shortcode – Shortcode not work in the template if set true.
- disable_excerpt_filters – filters not work for the excerpt if set true.
exemplo de ganchos de filtro
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';
}
?>
Modelo padrão
<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>
Variáveis do modelo
- %post_id% – ID da página
- %width% – Largura do bloco para páginas individuais
- %post_url% – Link permanente da página
- %post_thumb% – para miniatura do post
- %post_title% – Título da página
- %post_excerpt% – Resumo da página
Suporte
- http://wpist.me/wp/child-pages-shortcode/ (en)
- http://firegoby.theta.ne.jp/wp/child-pages-shortcode (ja)
Colaboradores
Créditos
This plug-in is not guaranteed though the user of WordPress can freely use this plug-in free of charge regardless of the purpose.
The author must acknowledge the thing that the operation guarantee and the support in this plug-in use are not done at all beforehand.
Contato
- http://wpist.me/
- @wpist_me
Instalação
- 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.
Perguntas frequentes
- Installation Instructions
-
- 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.
Avaliações
Colaboradores e desenvolvedores
“Child Pages Shortcode” é um programa de código aberto. As seguintes pessoas contribuíram para este plugin.
ColaboradoresChild Pages Shortcode” foi traduzido para 5 localidades. Agradecemos aos tradutores por suas contribuições.
Traduzir “Child Pages Shortcode” para seu idioma.
Interessado no desenvolvimento?
Navegue pelo código, consulte o repositório SVN ou assine o registro de desenvolvimento por RSS.
Registro de alterações
1.9.3
- Testado no WordPress 4.2.
1.9.2
- Testado no WordPress 4.1.
1.9.1
- correção de bug – js não encontrado
1.9.0
- correção de erro – erro de sintaxe de css
1.7.0
- correção de erro – wp_reset_postdata() ausente
1.6.0
- correção de erro
1.3.0
- setup_postdata() added.
1.2.0
- correção de erro
1.1.4
- bug fix on non-responsive theme
1.1.3
- Correção de erro
1.1.2
- Correção de erro
1.0.1
- Add filter hook “child-pages-shortcode-output”
0.9.0
- Add filter hook “child-pages-shortcode-query”
- Load stylesheet by wp_enqueue_style()
0.8.0
- Add style “max-width:100%”.
0.4.0
- adicionar
add_post_type_support("page", "excerpt");
0.3.0
- Adapt to no-image.
0.1.0
- Lançamento inicial.