WordPress.org

Ready to get started?Download WordPress

Forums

Need a bit of help (1 post)

  1. peiqinglong
    Member
    Posted 5 years ago #

    So I've got this chunk of code in my functions.php file:

    function about_page_excerpt() {
    
    	global $wpdb, $tableposts;
    
    		$aboutme = $wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE post_name = 'about'");
    
    	echo $aboutme; "<a href=\""; bloginfo(url); echo "Read more...</a>";
    
    }

    Basically what I'm trying to do is pull the contents of the About page and display it whenever the `<?php about_page_excerpt(); ?> is called.

    Everything works fine, except I can't figure out hot to keep the formatting. For example, if I have two paragraphs in the About page, what is shown is everything minus the <p>. How do I retain those? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.