July 15, 201412 yr I have a news page but the title of the page is being replicated by the latest blog post. Can someone tell me why that is happening please? http://tanrallt.co.uk/news/ Thank you!
July 15, 201412 yr Hey Aled, I think this is down to what is being called between the <h1> tags of that template. Are you able to copy the code from that section and paste it in here? Cheers,P
July 15, 201412 yr Author Well that's what I thought but I can't figure out why whoever built the site have built it the way they have. It's very odd. Here's the code on the latest-news.php file: <ul> <?php $type = 'post'; $args=array( 'post_type' => $type, 'exclude' => 'testimonials', 'post_status' => 'publish', 'posts_per_page' => 4 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <li> <div class="date"> <?php echo get_the_date('<\sp\a\n \c\l\a\s\s="\m\o\n\t\h">M<\/\s\p\a\n\><\sp\a\n \c\l\a\s\s="\d\a\y">dS<\/\s\p\a\n\>'); ?> </div> <a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; } wp_reset_query(); ?> </ul>
July 15, 201412 yr Yeah that looks strange for what the page is doing as the above query should show only four posts per page. <div class="article-header"> <div class="breadcrumbs"> <!-- Breadcrumb NavXT 5.1.0 --> <span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="Go to Luxury Holiday Lodges and Static Caravans for Sale or Rental in North Wales." href="http://tanrallt.co.uk" class="home">Home</a></span> > <span typeof="v:Breadcrumb"><span property="v:title">News</span></span></div> <h1>The Cliffs Friday Night Fever Evening</h1> </div><!--/article-header --> Looking at the source this is the section that you should be looking for - the article header and within the H1 tags there should be something similar to <?php the_title(); ?> that is being called to give the title of the page
August 4, 201412 yr Are you sure that's the right template? The reason I ask is that its a bit odd to call a template that queries testimonials "latest-news.php". I'm also not seeing a permalink reference in the source code. There is a really handy little plugin called What the File if you want an easy way to see which template is being called.
Create an account or sign in to comment