heartofwisdom
Member
Posted 4 years ago #
My Recent Posts Links are not working correctly. Sometimes they work sometimes I get Sorry, no posts matched your criteria.
See http://Heartofwisdom.com/blog
Permalinks are set to /%scategory%/%postname%/
My Popular links work but Recent not usually.
Any help appreciated.
cryonics
Member
Posted 4 years ago #
Permalinks are set to /%scategory%/%postname%/
Is there really a trailing slash?
heartofwisdom
Member
Posted 4 years ago #
Yes I just checked. ANY help appreciated!
heartofwisdom
Member
Posted 4 years ago #
When I click on the recent post "Should Homeschoolers Teach Logic" the link should be
http://heartofwisdom.com/blog/homeschool/should-homeschoolers-teach-logic
but in recent post its
http://heartofwisdom.com/blog/spiritual-growth/object-lessons/be-the-branch/?p=304
Here is the code<h2 class="coltitle">Recent posts</h2>
<?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 15")):
?>
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "
- ID'>";
the_title();
echo '
';
}
?>
<?php endif; ?>
heartofwisdom
Member
Posted 4 years ago #
I went back to my original files and replaced the code. The home page links are workig but if I am on another page the links don't work.
Any ideas?
cryonics
Member
Posted 4 years ago #
Try
/%category%/%postname%