Jim R Posted February 15, 2010 Share Posted February 15, 2010 I linked the test page for the code below. It's producing the functional results I want, but the list bullets are askew and, as you will see, it's just printing the URL not producing a hyperlink. http://hoosierhoopsreport.com/test.php $mf_query = <<<EOF SELECT t.*, tt.*, p.* FROM {$wpdb->posts} as p, {$wpdb->term_relationships} as tr, {$wpdb->terms} AS t, {$wpdb->term_taxonomy} AS tt WHERE tt.`taxonomy` = 'series' AND t.`term_id` = tt.`term_id` AND tr.`object_id` = p.`ID` AND tt.`term_taxonomy_id` = tr.`term_taxonomy_id` AND tt.`count` > 0 GROUP BY t.`term_id` ORDER BY p.`post_date` DESC LIMIT 5 EOF; $mf_terms = $wpdb->get_results( $mf_query ); if( !empty( $mf_terms ) ) { foreach ( $mf_terms as $mf_term ) { $loop = new WP_Query( array( 'series' => $mf_term->slug ) ); if ( $loop->have_posts() ) : echo '<b>' . $mf_term->name . '</b>'; echo '<ul>'; while ( $loop->have_posts() ) : $loop->the_post(); echo '<li><a href="' . the_permalink() . '">' . the_title() . '</a></li>'; endwhile; wp_reset_query(); echo '</ul>'; endif; } } Quote Link to comment https://forums.phpfreaks.com/topic/192084-wordpresshaving-a-problem-echoing-an-href/ Share on other sites More sharing options...
khr2003 Posted February 15, 2010 Share Posted February 15, 2010 check the content of the_permalink function. it is probable that it is returning a correct value Quote Link to comment https://forums.phpfreaks.com/topic/192084-wordpresshaving-a-problem-echoing-an-href/#findComment-1012462 Share on other sites More sharing options...
Jim R Posted February 15, 2010 Author Share Posted February 15, 2010 I literally just figured it out. I added get_ in front of the_permalink and the_title. This is kind of stuff that makes me thankful I don't code for a living. This took me a whole day, as it was producing the values I wanted, just not in hyperlink form. I tried another href statement, and it worked just fine. Not sure if it applies to my problem, but I read something in WordPress that the_title strips out the HTML attributes. Then it said something like See Also: get_the_title. I tried it. It worked. Thanks for looking at it though. I was a little worried it would be overlooked after it was moved. Quote Link to comment https://forums.phpfreaks.com/topic/192084-wordpresshaving-a-problem-echoing-an-href/#findComment-1012463 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.