get parent fields title, content excerpt etc

You can try get_post($post->post_parent) or get_page($post->post_parent) so if you do: $parent = get_post($post->post_parent); You can get the title like this: $parent->post_title; And anything you want, you can var_dump($parent) to see all the post info you can use.

post var problem with shortcode loop

you really shouldn’t use query_posts() for anything other then the main query of the page. Instead you should use wp_query() or get_posts() , also since you return a value before running wp_reset_query() then its never actually being reset. so change your shortcode to this: function casestudy_shortcode($atts){ extract(shortcode_atts(array( ‘type’ => ‘case_studies’, ‘limit’ => ‘1’, ‘case’ => … Read more

Query add html after set amount of posts?

Here’s one way of doing it: <?php $courses = get_posts( array( ‘post_type’ => ‘courses’, ‘posts_per_page’ => -1 ) ); if ( $courses ) { print “\n” . ‘<div style=”background:pink”>’; foreach ( $courses as $course_count => $post ) { setup_postdata( $post ); the_title( “\n”, ‘<br>’ ); if ( 5 == $course_count ) { print “\n” . … Read more

Latest 5 post excerpts from 5 different authors in Sidebar

Think I’ve figured it out. Here’s the code I used courtesy of this thread on the WP Support Forum. Just replace ()<?php the_author_posts_link(); ?>() with whatever excerpt code you want to use. And Voila! <?php //list 5 latest authors $authors = array(); $count = 0; $args=array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, … Read more