0

I wont to get short content in my footer area. So, I write my code as follow:

   $page = get_page_by_title( 'About us' );
   $content = apply_filters('the_content', $page->post_content);  ?>
   <p> <?php echo $content; ?> </p>

By this code I get full page content. So how can I get short content till my setted <--read more--> link in the about us page?

0

I believe your best solution will be to setup postdata and the making use of the the_content() template tag

$post = get_page_by_title( 'About us' );
setup_postdata( $post ); ?>
    <p> <?php the_content(); ?> </p>
<?php wp_reset_postdata(); ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.