RamonTav 1 Denunciar post Postado Novembro 21, 2012 Bom dia pessoal, Como eu poderia listas trechos dos titulos de child pages randown de uma determinada página dentro da minha home? Que ficasse assim: Child Page01... Child Page02... Child Page03... Child Page04... Veja Mais e que fosse chamado por um shortcode ou se existe algum plugin ou widget Se alguém puder min ajudar ficaria muito grato. Obrigado! Compartilhar este post Link para o post Compartilhar em outros sites
RamonTav 1 Denunciar post Postado Novembro 21, 2012 Consegui listar com este seguinte código, mais ele não limita o numero de registro e nem colocar "..." alguem poderia me ajudar? //Add a shortcode for listing child pages of a parent page function list_pages_shortcode( $atts ) { // Basic shortcode markup extract( shortcode_atts( array( 'post_parent' => false, 'title' => '', ), $atts ) ); //If the post parent attribute isn't specified, use the current post's ID if ( ! $post_parent ) { global $post; if ( is_object( $post ) ) { $post_parent = $post->ID; } else { return false; } } //Build the arguments - we want the child of the post_parent $args = array( 'depth' => 3, 'child_of' => $post_parent, 'title_li' => $title, 'echo' => 0, 'sort_column' => 'menu_order, post_title' ); // if there is no title lets barf up the wordpress pages instead if ( empty( $title ) ) { return "<ul>" . wp_list_pages( $args ) . "</ul>"; } else { return wp_list_pages( $args ); } } add_shortcode( 'list_subpages', 'list_pages_shortcode' ); [list_subpages post_parent=3] Compartilhar este post Link para o post Compartilhar em outros sites