I am a bit confused on how this may be achieved. I have a website that I have coded already with static HTML/CSS and I am trying to incorporate it into wordpress. The challenge though is that the website is single page index.html file with 4 "sections". I want each section to be a page that can be accessed by anyone to edit the content at a later date. I have figured out how to get the page to loop out my four pages through other stackoverflow resources, however the challenge I am facing is the HTML markup.
Is there a way to make each section loop out different HTML for that given section? Each section is formatted differently.
For example, section one may have 4 divs, while section three has one div and it is a different ID. The current loop only will loop out the same kind of HTML.
I've read about custom fields which I plan to incorporate for specific parts of the sections, but from a wider scope, I can't figure out how to get different HTML markup for each section first.
<?php $pages = get_pages();
foreach ($pages as $page_data) {
$content = apply_filters('the_content', $page_data->post_content);
$title = $page_data->post_title;
$slug = $page_data->post_name;
echo "<div id='$slug'>";
echo "<h2>$title</h2>";
echo $content;
echo "</div>";
}
?>