Pulling Pages into Pages nesting HTML within echo statements
-
Hey all,
I’m pulling a page into my custom home page. I know how to do this using categories as I do using pages. However what I’m lacking what should be some basic PHP principals of syntax.
Here I’m pulling my Page of info into my home page using:
<div class="test_page"> <?php $page_id = 41; //ID of page from your WP admin panel $page_data = get_page( $page_id ); echo $page_data->post_title; // Show page title echo $page_data->post_content; // Show page content ?> </div>
It works perfect!
What I can’t seem to figure out reading at PHP.net is how to properly nest HTML within the Echo statement ie:
echo $page_data->post_title('<h1> the_title();</h1>');
I would like to place some H1 tags around the title portion of this.
Any insight would be much appreciated.
~ Jonny
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pulling Pages into Pages nesting HTML within echo statements’ is closed to new replies.