Support » Plugins » Trying to show the contents of a specific post

  • Resolved peiqinglong

    (@peiqinglong)


    Ok, so I’m trying to learn more about plugins and the functions.php file. What I’m trying to accomplish is to query the WP database and find the post_name of About and display it. This is what I have in my functions.php file:

    function about_page_excerpt() {
    
    	global $wpdb, $tableposts;
    
    	$aboutme = $wpdb->get_col("SELECT post_content FROM $wpdb->posts WHERE post_name = 'about'");
    
    	echo $aboutme;
    
    }

    Now when I try to use <?php about_page_excerpt(); ?> I get Array as the display. What am I doing wrong? Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Trying to show the contents of a specific post’ is closed to new replies.