using silverstripe data object concept in wordpress

I am new to wordpress, I come from Silvestripe development.

I have developed a FAQ accordion that has a tittle and description.

Read More

In silverstripe I would create a dataobject, relate it to the desired page and then output it by looping through the records in the template.

<div class="accordionContainer">
<ul>
    <% loop accordion %>    //loop data object          
              <li>
                  <h2 class="accordionHeader"><a href="#">$Title</a></h2>
                  <div class='accordionContent'>
                     <div class ="accordionBlock">
                         $Description
                      </div>
                  </div>
              </li>                          
    <% end_control %>
    </ul>  
    </div>

How can this be achieved in wordpress??

Thank you in advance 🙂

Related posts

Leave a Reply

1 comment