{"id":6190337,"date":"2015-06-02T15:01:03","date_gmt":"2015-06-02T15:01:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/adding-php-to-a-div\/"},"modified":"2016-08-30T14:01:22","modified_gmt":"2016-08-30T14:01:22","slug":"adding-php-to-a-div","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/adding-php-to-a-div\/","title":{"rendered":"Adding PHP to a DIV"},"content":{"rendered":"<p>This might be a stupid question but I just can&#8217;t figure it out. I want to add some PHP to a DIV inside my custom theme. Everytime I add the code inside a DIV it jumps out. <\/p>\n<p>Link to page:<br \/>\nhttp:\/\/reinowo58.fiftyeight.axc.nl\/hoe\/<\/p>\n<p>As you can see on the right side there are 2 divs. I added a piece of PHP to the container that grabs the latest post. But it appears outside the DIV. <\/p>\n<p>This is the code:<\/p>\n<pre><code>&lt;div style=&quot;width: 250px; height: 325px; background-color: #ebecec; border-radius: 25px; padding: 25px;&quot;&gt;\n&lt;div style=&quot;width: 170px; height: 40px; background-color: #fb3099; border-radius: 18px; margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;\n&lt;h2 style=&quot;padding-top: 14px;&quot;&gt;NIEUWS&lt;\/h2&gt;\n&lt;\/div&gt;\n[insert_php] query_posts(&#039;showposts=1&#039;); [\/insert_php]\n[insert_php] while (have_posts()) : the_post(); [\/insert_php]\n[insert_php] endwhile;[\/insert_php]\n\n&lt;\/div&gt;<\/code><\/pre>\n<p>As you can see on the page the text is on the bottom of the page instead of inside the DIV. Please help me out with this one.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/insert-php\/<\/p>\n","protected":false},"template":"","class_list":["post-6190337","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6190337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6190337\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6190337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}