wordpress - get contents and permalink base on the specified page title on the query -


below query supposed contents page specified page title

<?php     $page = get_page_by_title( 'about us' );     $content = apply_filters('the_content', $page->post_content);       the_content_rss('', true, '', 100); ?>      <a href="<?php the_permalink() ?>" title="read whole post" class="rm">read more</a> 

and yes display content , trim content 100, problem content , permalink not content , permalink of specified page pulled query, mean, content , permalink different page im pulling up. ideas whats going on? im trying play around code seems nothing works @ , im looking on web possible solution unfortunately, find nothing.

ps: want display content , permalink of specified page im pulling through query above.

could try following code?

<?php     $page = get_page_by_title( 'about us' );     $content = apply_filters('the_content', $post->post_content);      echo substr($content,0,30);   ?>  <a href="<?php echo esc_url( get_permalink( $page->id ) ); ?>">title="read whole post" class="rm">read more</a> 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -