Quantcast
Viewing all articles
Browse latest Browse all 8245

f.n174 on "wordpress inserts my plugin data one into another!"

hi , im writing my first wordpress plugin. i created a main plugin page and 2 admin pages , and my javascript and core data are in main plugin page . my plugin creates a widget area , so users are able to insert widget into it and i get widgets from that widget area in my plugin main file.
now the problem is that when wordpress runs my plugin for first time decides to insert my javascript code in head and every time i insert new widget into that widget area wordpress inserts that with its new codes within past one !. look at code below :

<div class="numberone"><?php $widgets; ?> </div>

the output of above code(without adding any widgets to its widget area) is some thing like this :

<div class="numberone">
</div>

but when i insert widget to my widget area my code becomes something like this

<div class="numberone">
<div class="numberone">
<h1>mydiget</h1>
</div>
</div>

when i insert two widgets that becomes like this :

<div class="numberone">

<div class="numberone">
<h1>mydiget</h1>
</div>

<div class="numberone">
<h1>mydiget2</h1>
</div>

</div>

can some one tell me how to resolve that problem because i want some thing like below code :

<div class="numberone">

<h1>mydiget</h1>

<h1>mydiget2</h1>

</div>

Viewing all articles
Browse latest Browse all 8245

Trending Articles