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.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
You can solve this in different ways. One it's to use simple querys with WP_Query and using the p parameter to retrive a particular post like it's explained here. Something like this:
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:
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 |
||||
|