Thanks for looking at this.
1. No error message with start_wp (); but the actual page content doesn’t display. I did try setup_postdata($post); when attempting to problem solve and when I used that the page content on every page displays the testimonial details ie. home page should have home page info (well full in text at the moment!) but whatever random testimonial was displayed in sidebar – the content would display in homepage… same when I go to about page.
This problem also occurs with the Recent news if the Testimonials are not displayed in the left sidebar. The code I used to display the recent news is:
<?php $posts = get_posts("category=6" . $cat->cat_ID . "&numberposts=4");
if( $posts ) : ?>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<li><a href="<?php // bump out what we need courtesy of template tags
the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
Here is the url to the development site so you can see for yourself: https://tbminsurance.slicetest.co.nz/. (unless I have managed to fix by the time you look at it). If I remove the testimonial block the recent news article title shows in whatever page I am on. If the testimonial block is there then the testimonial content displays.
It is strange as this problem does not occur when I put either of the code in the right menu, just the left. I can’t think where else the problem is coming from.
2. The excerpt is set up in functions:
<?php
// Sets the post excerpt length to 40 characters.
add_filter( 'excerpt_length', 'texcerpt_length' );
function excerpt_length( $length ) {
return 40;
}
add_filter('excerpt_length', 'new_excerpt_length');
function excerpt_ellipse($text) {
return str_replace('[...]', ' <a href="'.get_permalink().'"> more...</a>', $text); }
add_filter('the_excerpt', 'excerpt_ellipse');
function new_excerpt_more($more) {
$ct=get_the_category($post->ID); $ct = $ct[0]->cat_ID;
return '<a href="'. get_category_link($ct) . '"> more ...</a>';
}
add_filter( 'excerpt_more', 'auto_excerpt_more' );
?>
3. readmore: That was my mistake – eyeballs tired from trying to sort out the above problem so overlooked this. Thanks for pointing it out!
Do you have any idea why the sidebar content is being displayed in all the pages?
Thanks so much. I have spent hours trying to figure this one out so any help would be very much appreciated.