actusanima
3/1/2018 - 11:05 PM

WORDPRESS

WORDPRESS QUERIES



<?php
// ********************************************************** get child pages of current page
$args = array(
    'post_type'      => 'page',
    'posts_per_page' => -1,
    'post_parent'    => $post->ID,
    'order'          => 'ASC',
    'orderby'        => 'menu_order'
 );


$parent = new WP_Query( $args );

if ( $parent->have_posts() ) : ?>

    <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>

        <div id="parent-<?php the_ID(); ?>" class="parent-page">

            <h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

            <p><?php the_advanced_excerpt(); ?></p>

        </div>

    <?php endwhile; ?>

<?php endif; wp_reset_postdata(); ?>


<?php

the_excerpt();



// ΣΤΟ functions.php
function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );




echo wp_trim_words( get_the_content(), 35, '...' );

?>