Hello, I am trying to pull the first 10 words of text , and the featured image from 1 page, in to my sidebar on all pages.
I have used get_posts before to pull in posts form a a particular category setting the except length before like this:
$args = array( ‘numberposts’ => 1, ‘category_name’=> ‘Commission work’, ‘order’=> ‘DESC’, ‘orderby’ => ‘post_date’ );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post); ?>
<?php the_post_thumbnail(‘thumbnail’); ?>
” rel=”bookmark” title=”Permanent Link to
<?php the_title_attribute(); ?>”><?php the_title(); ?>
$excerpt = get_the_excerpt();
– and want to do the same but pulling from a particular page instead of a post in a category. I cannot see how to do this although i have seen the get_page_with_title page on here but cannot work out how to swap over easily!
Any suggestions for the code i need to use in my sidebar.php?
Many thanks in advance for all help!!