Wordpress Query on a Page using Allow PHP in Posts and Pages Plugin -
it want do, displays category of posts in column on page. right title, want link title , permalink section isnt working, or rather href.
[php] // query $the_query = new wp_query( 'cat=3' ); // loop if ( $the_query->have_posts() ) { echo '<ul style="list-style:none;">'; while ( $the_query->have_posts() ) { $the_query->the_post(); echo '<li>' . '<a href="the_permalink();">' . get_the_title() . '[/a]'. '</li>'; } echo '</ul>'; } else { // no posts found } /* restore original post info */ wp_reset_postdata(); [/php] it links subdomain.domain.com/site/the_permalink(); instead pulling permalink post , linking it.
the_permalink(); homecoming echo link. need homecoming string. can utilize get_the_permalink($post->id); because permalink function within of echo function.
php wordpress
No comments:
Post a Comment