Absolute beginner question: I need to load text into specific div tags across the page. On my html mockup its a lorem ispum text box waiting for wordpress to load the real content. So, how do i control the real content and its relation with the div box text on the page? Can it be a post, so i can manage it from the dashboard? Thanks in advance.
You can solve this in different ways.
$the_query = new WP_Query( 'p=123' ); while ( $the_query->have_posts() ) : $the_query->the_post(); the_content(); endwhile;
Where 123 it's the post id from where you need the data (the_content).
Or you can query the content from a single post using get_post function. Like this:
$postid = 123; $queryp = get_post($postid); $content = $queryp->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content;
Where 123, again, it's the postid from where you need to extract the content.
And i think wp_get_single_post function should work too.
Then you can control your content everywhere just extracting the desired data from certains posts by postid